public new void UpdateStyles() { cbStyles.ComboBox.Items.Clear(); _FontStyleComboBoxHelper = new ComboBoxHelper <RtfControlStyle>(cbStyles.ComboBox); _FontStyleComboBoxHelper.ManualSelectedIndexChanged += _FontStyleComboBoxHelper_ManualSelectedIndexChanged; _FontStyleComboBoxHelper.Fill(StyleCollection.Instance.Styles); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); /* * CellRendererText idCellRendererText = new CellRendererText(); * comboBox.PackStart(idCellRendererText, false); * comboBox.AddAttribute(idCellRendererText,"text",0); * * * CellRendererText labelCellRendererText = new CellRendererText(); * comboBox.PackStart(labelCellRendererText, false); * comboBox.AddAttribute(labelCellRendererText, "text", 1); * * * * * ListStore listStore = new ListStore(typeof(string), typeof(string)); * comboBox.Model = listStore; * TreeIter treeIter = listStore.AppendValues("0", "<sin asignar>"); * listStore.AppendValues("1", "cat 1"); * listStore.AppendValues("2 ","cat 2"); * listStore.AppendValues("3", "cat 3"); * * comboBox.SetActiveIter(treeIter);*/ App.Instance.Connection = new MySqlConnection("server=localhost;database=bdprueba;user=root;password=sistemas"); App.Instance.Connection.Open(); ComboBoxHelper.Fill(comboBox, " select id, nombre from categoria order by nombre", 0); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); App.Instance.Connection = new MySqlConnection("server=localhost;database=dbprueba;user=root;password=sistemas"); App.Instance.Connection.Open(); ComboBoxHelper.Fill(comboBox, "select id, nombre from categoria order by nombre", 0); }
public RtfControl() { InitializeComponent(); DoubleBuffered = true; btBold.Click += BtBold_Click; btItalic.Click += BtItalic_Click; btUnderline.Click += BtUnderline_Click; btSwitchTheme.Click += BtSwitchTheme_Click; btForeColor.Click += BtForeColor_Click; btIndentMin.Click += BtIndentMin_Click; btIndentPlus.Click += BtIndentPlus_Click; btBullets.Click += BtBullets_Click; btAlignLeft.Click += BtAlignLeft_Click; btAlignRight.Click += BtAlignRight_Click; btAlignCenter.Click += BtAlignCenter_Click; btFont.Click += BtFont_Click; rtf.MouseUp += Rtf_MouseUp; rtf.SelectionChanged += Rtf_SelectionChanged; rtf.TextChanged += Rtf_TextChanged; rtf.KeyDown += Rtf_KeyDown; rtf.ZoomFactor = 1; toolStrip1.Resize += ToolStrip1_Resize; _FontSizeComboBoxHelper = new ComboBoxHelper <int>(cmbFontSize.ComboBox); _FontSizeComboBoxHelper.ManualSelectedIndexChanged += _FontSizeComboBoxHelper_ManualSelectedIndexChanged; _FontSizeComboBoxHelper.Fill(new int[] { 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 }); updateStyle.Click += UpdateStyle_Click; addStyle.Click += AddStyle_Click; removeStyle.Click += RemoveStyle_Click; ttimg = global::CodeLibrary.Controls.Properties.Resources.ttfbmp; _FontComboBoxHelper = new ComboBoxHelper <string>(cmbFont.ComboBox); _FontComboBoxHelper.ManualSelectedIndexChanged += _FontComboBox_ManualSelectedIndexChanged; _FontComboBoxHelper.Fill(FontFamily.Families.Where(f => f.IsStyleAvailable(FontStyle.Regular)).Select(s => s.Name)); UpdateStyles(); cmbFont.ComboBox.DrawItem += ComboBox_DrawItem; cmbFont.ComboBox.MeasureItem += ComboBox_MeasureItem; cmbFont.ComboBox.DropDown += ComboBox_DropDown; cmbFont.ComboBox.MaxDropDownItems = 20; cmbFont.ComboBox.IntegralHeight = false; cmbFont.ComboBox.Sorted = false; cmbFont.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList; cmbFont.ComboBox.DrawMode = DrawMode.OwnerDrawVariable; this.Resize += RtfControl_Resize; }
public ArticuloWindow(Articulo articulo) : base(Gtk.WindowType.Toplevel) { this.Build(); entryNombre.Text = articulo.Nombre; spinButtonPrecio.Value = Convert.ToDouble(articulo.Precio); ComboBoxHelper.Fill( comboBoxCategoria, "select id, nombre from categoria order by nombre", articulo.Categoria ); //entryCategoria.Text = articulo.Categoria.ToString(); saveAction.Activated += delegate { articulo.Nombre = entryNombre.Text; articulo.Precio = Convert.ToDecimal(spinButtonPrecio.Value); //articulo.Categoria = long.Parse(entryCategoria.Text); ArticuloDao.Save(articulo); Destroy(); }; }