private void UpdateResultsDisplay() { //update the display with new colors txtResults.ModifyBase(txtResults.State, btnResultsBackColor.Color); txtResults.ModifyText(txtResults.State, btnResultsForeColor.Color); // remove the tag if exists TextTag temp = txtResults.Buffer.TagTable.Lookup("highlight"); if (temp != null) { txtResults.Buffer.TagTable.Remove(temp); } // create new tag and add TextTag tag = new TextTag("highlight"); tag.BackgroundGdk = btnMatchBackColor.Color; tag.ForegroundGdk = btnMatchForeColor.Color; txtResults.Buffer.TagTable.Add(tag); // highlight match int pos = txtResults.Buffer.Text.IndexOf("match"); TextIter start = txtResults.Buffer.GetIterAtLineOffset(1, pos); TextIter end = txtResults.Buffer.GetIterAtLineOffset(1, pos + "match".Length); txtResults.Buffer.ApplyTag("highlight", start, end); }
public notas_medicas(string LoginEmp, string NomEmpleado_, string AppEmpleado_, string ApmEmpleado_, string title_window, string name_field_, string pidpaciente_, string folioservicio_, string iddoctor_, string nombredoctor_, string nombrepaciente_, bool altapaciente_, string edadpaciente_, string diagnosticoadmision_) { 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; LoginEmpleado = LoginEmp; NomEmpleado = NomEmpleado_; AppEmpleado = AppEmpleado_; ApmEmpleado = ApmEmpleado_; name_field = name_field_; pidpaciente = pidpaciente_; folioservicio = folioservicio_; nombredoctor = nombredoctor_; diagnosticoadmision = diagnosticoadmision_; sql_pidpaciente = " AND osiris_his_informacion_medica.pid_paciente = '" + pidpaciente + "' "; sql_folioservicio = " AND osiris_his_informacion_medica.folio_de_servicio = '" + folioservicio + "' "; sql_filtronotasblanco = " AND " + name_field + " <> '' "; Glade.XML gxml = new Glade.XML(null, "hospitalizacion.glade", "notas_medicas_enfermeria", null); gxml.Autoconnect(this); notas_medicas_enfermeria.Show(); notas_medicas_enfermeria.SetPosition(WindowPosition.Center); // centra la ventana en la pantalla notas_medicas_enfermeria.Title = title_window; button_salir.Clicked += new EventHandler(on_cierraventanas_clicked); button_guardar.Clicked += new EventHandler(on_button_guardar_clicked); button_imprimir_notas.Clicked += new EventHandler(on_button_imprimir_notas_clicked); checkbutton_selectall.Clicked += new EventHandler(on_checkbutton_selectall_clicked); entry_fechanotas.Text = (string)DateTime.Now.ToString("yyyy-MM-dd"); entry_pid_paciente.Text = (string)pidpaciente; entry_nombre_paciente.Text = (string)nombrepaciente_; entry_numerotencion.Text = (string)folioservicio; entry_id_doctor.Text = (string)iddoctor_; entry_doctor.Text = (string)nombredoctor_; entry_edad_paciente.Text = (string)edadpaciente_; // action somatometria button_guardar_somato.Clicked += new EventHandler(on_button_guardar_somato_clicked); // Cambiando el color del fondo para distinguir la ventana switch (name_field) { case "notas_de_evolucion": textview1.ModifyBase(StateType.Normal, new Gdk.Color(255, 243, 169)); // Color Amarillo break; case "notas_de_enfermeria": textview1.ModifyBase(StateType.Normal, new Gdk.Color(255, 179, 235)); // Color Rosa break; case "indicaciones_medicas": textview1.ModifyBase(StateType.Normal, new Gdk.Color(152, 255, 255)); // Color Rosa break; } if (altapaciente_ == false) { button_guardar.Sensitive = false; textview2.Sensitive = false; entry_fechanotas.Sensitive = false; combobox_hora_nota.Sensitive = false; combobox_minutos_nota.Sensitive = false; } crea_treeview_notas(); crea_treeview_somatometria(); llena_horas_notas(); llenando_informacion(); }
public cSyntax(string _scheme, ref Gtk.TextView _textview, bool _onlybackground) { //TODO: Create example scheme string[] content = System.IO.File.ReadAllLines(_scheme); g_noneColorDescription = content[0].Split(new char[] { ';' })[1]; g_colorCorrectDescription = content[1].Split(new char[] { ';' })[1]; g_edgedBracketsColorDescription = content[2].Split(new char[] { ';' })[1]; g_roundBracketsColorDescription = content[3].Split(new char[] { ';' })[1]; g_otherBracketsColorDescription = content[4].Split(new char[] { ';' })[1]; g_constantColorDescription = content[5].Split(new char[] { ';' })[1]; g_QuantifierColorDescription = content[6].Split(new char[] { ';' })[1]; g_BackGroundColor = content[7].Split(new char[] { ';' })[1]; if (_onlybackground == false) { TextTag tagnone = new TextTag("nosyntax"); Gdk.Color nonecolor = new Gdk.Color(); Gdk.Color.Parse(g_noneColorDescription, ref nonecolor); tagnone.ForegroundGdk = nonecolor; _textview.Buffer.TagTable.Add(tagnone); TextTag tagcorrect = new TextTag("backslashliteral"); Gdk.Color colorcorrect = new Gdk.Color(); Gdk.Color.Parse(g_colorCorrectDescription, ref colorcorrect); tagcorrect.ForegroundGdk = colorcorrect; tagcorrect.FontDesc = getBold(); _textview.Buffer.TagTable.Add(tagcorrect); TextTag edgedBrackets = new TextTag("edgedBrackets"); Gdk.Color coloredgetBrackets = new Gdk.Color(); Gdk.Color.Parse(g_edgedBracketsColorDescription, ref coloredgetBrackets); edgedBrackets.ForegroundGdk = coloredgetBrackets; _textview.Buffer.TagTable.Add(edgedBrackets); TextTag roundBrackets = new TextTag("roundBrackets"); Gdk.Color colorroundbrackets = new Gdk.Color(); Gdk.Color.Parse(g_roundBracketsColorDescription, ref colorroundbrackets); roundBrackets.ForegroundGdk = colorroundbrackets; _textview.Buffer.TagTable.Add(roundBrackets); TextTag otherBrackets = new TextTag("otherBrackets"); Gdk.Color otherBracketsColor = new Gdk.Color(); Gdk.Color.Parse(g_otherBracketsColorDescription, ref otherBracketsColor); otherBrackets.ForegroundGdk = otherBracketsColor; otherBrackets.FontDesc = getBold(); _textview.Buffer.TagTable.Add(otherBrackets); TextTag constant = new TextTag("constant"); Gdk.Color constantcolor = new Gdk.Color(); Gdk.Color.Parse(g_constantColorDescription, ref constantcolor); constant.ForegroundGdk = constantcolor; _textview.Buffer.TagTable.Add(constant); TextTag quantifier = new TextTag("quantifier"); Gdk.Color quantifiercolor = new Gdk.Color(); Gdk.Color.Parse(g_QuantifierColorDescription, ref quantifiercolor); quantifier.ForegroundGdk = quantifiercolor; Gdk.Color backgroundcolor = new Gdk.Color(); Gdk.Color.Parse(g_BackGroundColor, ref backgroundcolor); _textview.ModifyBase(StateType.Normal, backgroundcolor); _textview.Buffer.TagTable.Add(quantifier); } else { Gdk.Color backgroundcolor = new Gdk.Color(); Gdk.Color.Parse(g_BackGroundColor, ref backgroundcolor); _textview.ModifyBase(StateType.Normal, backgroundcolor); } }