Exemplo n.º 1
0
        void llenacombo_contrato()
        {
            combo_tipocontrato.Clear();
            CellRendererText cell = new CellRendererText();

            combo_tipocontrato.PackStart(cell, true);
            combo_tipocontrato.AddAttribute(cell, "text", 0);

            ListStore store = new ListStore(typeof(string));

            combo_tipocontrato.Model = store;

            store.AppendValues((string)"");
            store.AppendValues((string)"DETERMINADO (1 MES)");
            store.AppendValues((string)"DETERMINADO (2 MESES)");
            store.AppendValues((string)"DETERMINADO (3 MESES)");
            store.AppendValues((string)"INDETERMINADO");
            store.AppendValues((string)"HONORARIOS (ASIMILABLES)");
            store.AppendValues((string)"PRACTICAS");

            TreeIter iter;

            if (store.GetIterFirst(out iter))
            {
                combo_tipocontrato.SetActiveIter(iter);
            }
            combo_tipocontrato.Changed += new EventHandler(onComboBoxChanged_tipocontrato);
        }
Exemplo n.º 2
0
        void llena_horas_notas()
        {
            combobox_hora_nota.Clear();
            CellRendererText cell2 = new CellRendererText();

            combobox_hora_nota.PackStart(cell2, true);
            combobox_hora_nota.AddAttribute(cell2, "text", 0);
            ListStore store2 = new ListStore(typeof(string), typeof(int));

            combobox_hora_nota.Model = store2;
            for (int i = 1; i < (int)classpublic.horario_24_horas + 1; i++)
            {
                store2.AppendValues((string)i.ToString("00").Trim());
            }
            combobox_hora_nota.Changed += new EventHandler(onComboBoxChanged_hora_minutos_cita);

            combobox_minutos_nota.Clear();
            CellRendererText cell3 = new CellRendererText();

            combobox_minutos_nota.PackStart(cell3, true);
            combobox_minutos_nota.AddAttribute(cell3, "text", 0);
            ListStore store3 = new ListStore(typeof(string), typeof(int));

            combobox_minutos_nota.Model = store3;
            for (int i = (int)0; i < 60; i = i + (int)classpublic.intervalo_minutos)
            {
                store3.AppendValues((string)i.ToString("00").Trim());
            }
            combobox_minutos_nota.Changed += new EventHandler(onComboBoxChanged_hora_minutos_cita);

            combobox_hora_somato.Clear();
            CellRendererText cell4 = new CellRendererText();

            combobox_hora_somato.PackStart(cell4, true);
            combobox_hora_somato.AddAttribute(cell4, "text", 0);
            ListStore store4 = new ListStore(typeof(string), typeof(int));

            combobox_hora_somato.Model = store4;
            for (int i = 1; i < (int)classpublic.horario_24_horas + 1; i++)
            {
                store4.AppendValues((string)i.ToString("00").Trim());
            }
            combobox_hora_somato.Changed += new EventHandler(onComboBoxChanged_hora_minutos_cita);

            combobox_minutos_somato.Clear();
            CellRendererText cell5 = new CellRendererText();

            combobox_minutos_somato.PackStart(cell5, true);
            combobox_minutos_somato.AddAttribute(cell5, "text", 0);
            ListStore store5 = new ListStore(typeof(string), typeof(int));

            combobox_minutos_somato.Model = store5;
            for (int i = (int)0; i < 60; i = i + (int)classpublic.intervalo_minutos)
            {
                store5.AppendValues((string)i.ToString("00").Trim());
            }
            combobox_minutos_somato.Changed += new EventHandler(onComboBoxChanged_hora_minutos_cita);
        }
Exemplo n.º 3
0
	void FillCombo (Gtk.ComboBox cb)
	{
		cb.Clear();
		CellRendererText cell = new CellRendererText ();
		cb.PackStart (cell, false);
		cb.AddAttribute (cell, "text", 0);
		ListStore store = new ListStore (typeof (string));
		cb.Model = store;

	}
Exemplo n.º 4
0
 public static void FillSizeCombo(ComboBox combo, string[] sizes)
 {
     combo.Clear ();
     var list = new ListStore (typeof(string));
     foreach (var size in sizes)
         list.AppendValues (size);
     combo.Model = list;
     CellRendererText text = new CellRendererText ();
     combo.PackStart (text, true);
     combo.AddAttribute (text, "text", 0);
 }
Exemplo n.º 5
0
        //utility method to clear a gtk combobox
        private void clearComboBox()
        {
            Gtk.ComboBox cb = this.loadComboBox;

            cb.Clear();
            CellRendererText cell = new CellRendererText();

            cb.PackStart(cell, false);
            cb.AddAttribute(cell, "text", 0);
            ListStore store = new ListStore(typeof(string));

            cb.Model = store;
        }
Exemplo n.º 6
0
        void PopulateCategoryOptionMenu(Tag t)
        {
            int history = 0;
            int i       = 0;

            categories = new List <Tag> ();
            var root = db.Tags.RootCategory;

            categories.Add(root);
            PopulateCategories(categories, root);

            category_option_menu.Clear();

            var cell2 = new CellRendererPixbuf();

            category_option_menu.PackStart(cell2, false);
            category_option_menu.AddAttribute(cell2, "pixbuf", 0);

            var cell = new CellRendererText();

            category_option_menu.PackStart(cell, true);
            category_option_menu.AddAttribute(cell, "text", 1);

            var store = new ListStore(new[] { typeof(Gdk.Pixbuf), typeof(string) });

            category_option_menu.Model = store;

            foreach (Category category in categories)
            {
                if (t.Category == category)
                {
                    history = i;
                }

                i++;
                string     categoryName  = category.Name;
                Gdk.Pixbuf categoryImage = category.Icon;

                store.AppendValues(new object[] {
                    categoryImage,
                    categoryName
                });
            }

            category_option_menu.Sensitive = true;
            category_option_menu.Active    = history;

            //category_option_menu.SetHistory ((uint)history);
            //category_option_menu.Active = (uint)history;
        }
Exemplo n.º 7
0
        void llenado_combobox_tipo_paciente()
        {
            // Llenado de combobox
            combobox_tipo_admision.Clear();
            CellRendererText cell2 = new CellRendererText();

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

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

            combobox_tipo_admision.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 osiris_his_tipo_admisiones " +
                                      "WHERE cuenta_mayor = 4000 " +
                                      "ORDER BY descripcion_admisiones;";

                NpgsqlDataReader lector = comando.ExecuteReader();
                store2.AppendValues("", 0);
                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);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Regenera un dropdown segun una lista pasada
        /// </summary>
        /// <param name="cb">ComboBox.</param>
        /// <param name="valores">Lista.</param>
        private void RepopulateComboBox(Gtk.ComboBox cb, List <string> valores)
        {
            cb.Clear();
            CellRendererText cell = new CellRendererText();

            cb.PackStart(cell, false);
            cb.AddAttribute(cell, "text", 0);
            ListStore store = new ListStore(typeof(string));

            cb.Model = store;

            foreach (string str in valores)
            {
                cb.AppendText(str);
            }
        }
Exemplo n.º 9
0
        void llenado_municipios(string tipo_, string descripcionmunicipio_)
        {
            combobox_municipios.Clear();
            CellRendererText cell3 = new CellRendererText();

            combobox_municipios.PackStart(cell3, true);
            combobox_municipios.AddAttribute(cell3, "text", 0);

            ListStore store3 = new ListStore(typeof(string));

            combobox_municipios.Model = store3;

            if (tipo_ == "selecciona")
            {
                store3.AppendValues((string)descripcionmunicipio_);
            }
            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 descripcion_municipio FROM osiris_municipios WHERE id_estado = '" + idestado.ToString() + "' " +
                                      "ORDER BY descripcion_municipio;";

                NpgsqlDataReader lector = comando.ExecuteReader();
                while (lector.Read())
                {
                    store3.AppendValues((string)lector["descripcion_municipio"]);
                }
            }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 iter3;

            if (store3.GetIterFirst(out iter3))
            {
                combobox_municipios.SetActiveIter(iter3);
            }
            combobox_municipios.Changed += new EventHandler(onComboBoxChanged_municipios);
        }
Exemplo n.º 10
0
    private void FillTestComboBox(Gtk.ComboBox cb)
    {
        cb.Clear();
        CellRendererText cell = new CellRendererText();

        cb.PackStart(cell, false);
        cb.AddAttribute(cell, "text", 0);
        ListStore store = new ListStore(typeof(string));

        cb.Model = store;

        store.AppendValues("BitBlt");
        store.AppendValues("Ellipse");
        store.AppendValues("Polygon");
        store.AppendValues("LineTo");
        store.AppendValues("PolylineTo");
    }
Exemplo n.º 11
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();
        }
Exemplo n.º 12
0
        public void BindCombobox(ComboBox cb, string [] values)
        {
            cb.Clear ();

            var store = new ListStore (typeof(string));
            cb.Model = store;

            foreach (var input in values) {
                store.AppendValues (input);
            }

            var text = new CellRendererText {Style = Pango.Style.Oblique};
            cb.PackStart(text,true);
            cb.AddAttribute (text, "text", 0);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="service">
        /// The <see cref="StreamrecorderService"/> that is being configured
        /// </param>
        /// <param name="previous_output_folder">
        /// A <see cref="System.String"/> containing the previously configured output directory
        /// </param>
        /// <param name="previous_encoder">
        /// A <see cref="System.String"/> containing the previously configured encoder
        /// </param>
        /// <param name="is_importing_enabled">
        /// A <see cref="System.Boolean"/> indicating whether file scanning was previously enabled
        /// </param>
        /// <param name="is_splitting_enabled">
        /// A <see cref="System.Boolean"/> indicating whether file splitting was previously enabled
        /// </param>
        public StreamrecorderConfigDialog(StreamrecorderService service, string previous_output_folder, string previous_encoder, bool is_importing_enabled, bool is_splitting_enabled)
        {
            streamrecorder_service = service;
            encoderbox.IdColumn    = 0;

            preferences_image.Yalign   = 0f;
            preferences_image.IconName = "gtk-preferences";
            preferences_image.IconSize = (int)IconSize.Dialog;
            preferences_image.Show();
            header_label.Text                 = String.Format(AddinManager.CurrentLocalizer.GetString("{0}Streamrecorder configuration\n{1}"), "<span weight=\"bold\" size=\"larger\">", "</span>");
            header_label.UseMarkup            = true;
            header_label.Wrap                 = true;
            header_label.Yalign               = 0f;
            header_label.Xalign               = 0f;
            description_label.Text            = AddinManager.CurrentLocalizer.GetString("Please select output folder for ripped files and if ripped\n" + "files should be imported to media library.\n");
            description_label.Yalign          = 0f;
            description_label.Xalign          = 0f;
            choose_folder_label.Text          = AddinManager.CurrentLocalizer.GetString("Output folder:");
            choose_encoder_label.Text         = AddinManager.CurrentLocalizer.GetString("Encoder:");
            output_folder.Text                = previous_output_folder;
            choose_output_folder_button.Label = AddinManager.CurrentLocalizer.GetString("_Browse");
            choose_output_folder_button.Image = new Image("gtk-directory", IconSize.Button);
            choose_output_folder_button.ShowAll();
            cancel_button.Label = AddinManager.CurrentLocalizer.GetString("_Cancel");
            cancel_button.Image = new Image("gtk-cancel", IconSize.Button);
            save_button.Label   = AddinManager.CurrentLocalizer.GetString("_Save");
            save_button.Image   = new Image("gtk-save", IconSize.Button);
            enable_import_ripped_songs.Label  = AddinManager.CurrentLocalizer.GetString("Import files to media library");
            enable_import_ripped_songs.Active = StreamrecorderService.IsImportingEnabledEntry.Get().Equals("True") ? true : false;
            enable_automatic_splitting.Label  = AddinManager.CurrentLocalizer.GetString("Enable automatic files splitting by Metadata");
            enable_automatic_splitting.Active = StreamrecorderService.IsFileSplittingEnabledEntry.Get().Equals("True") ? true : false;

            encoderbox.Clear();
            CellRendererText cell = new CellRendererText();

            encoderbox.PackStart(cell, false);
            encoderbox.AddAttribute(cell, "text", 0);
            ListStore store = new ListStore(typeof(string));

            encoderbox.Model = store;

            int row        = -1;
            int chosen_row = -1;

            foreach (string encoder in streamrecorder_service.GetEncoders())
            {
                row++;
                store.AppendValues(encoder);
                if (encoder.Equals(previous_encoder))
                {
                    chosen_row = row;
                    Hyena.Log.DebugFormat("[StreamrecorderConfigDialog] found active encoder in row {1}: {0}", encoder, chosen_row);
                }
            }

            if (chosen_row > -1)
            {
                Gtk.TreeIter iter;
                encoderbox.Model.IterNthChild(out iter, chosen_row);
                encoderbox.SetActiveIter(iter);
            }
            else
            {
                Gtk.TreeIter iter;
                encoderbox.Model.GetIterFirst(out iter);
                encoderbox.SetActiveIter(iter);
            }

            HBox main_container   = new HBox();
            VBox action_container = new VBox();

            main_container.Spacing     = 12;
            main_container.BorderWidth = 6;

            action_container.PackStart(header_label, true, true, 0);
            action_container.PackStart(description_label, true, true, 0);
            VBox choosing_labels = new VBox();

            choosing_labels.PackStart(choose_folder_label, true, true, 5);
            choosing_labels.PackStart(choose_encoder_label, true, true, 5);
            HBox folder_choosing = new HBox();

            folder_choosing.PackStart(output_folder, true, true, 5);
            folder_choosing.PackStart(choose_output_folder_button, true, true, 0);
            VBox box_choosing = new VBox();

            box_choosing.PackStart(folder_choosing, true, true, 0);
            box_choosing.PackStart(encoderbox, true, true, 5);
            HBox all_choosing = new HBox();

            all_choosing.PackStart(choosing_labels, true, true, 0);
            all_choosing.PackStart(box_choosing, true, true, 0);

            action_container.PackStart(all_choosing, true, true, 5);
            action_container.PackStart(enable_automatic_splitting, true, true, 5);
            action_container.PackStart(enable_import_ripped_songs, true, true, 5);

            main_container.PackStart(preferences_image, true, true, 5);
            main_container.PackEnd(action_container, true, true, 5);
            this.ContentArea.PackStart(main_container, true, true, 5);

            AddActionWidget(cancel_button, 0);
            AddActionWidget(save_button, 0);

            choose_output_folder_button.Clicked += new EventHandler(OnChooseOutputFolderButtonClicked);
            cancel_button.Clicked += new EventHandler(OnCancelButtonClicked);
            save_button.Clicked   += new EventHandler(OnSaveButtonClicked);

            Title       = "Streamrecorder configuration";
            IconName    = "gtk-preferences";
            Resizable   = false;
            BorderWidth = 6;
//            HasSeparator = false;
            this.ContentArea.Spacing = 12;

            ShowAll();
        }