private void titlefontchooserbtn_Click(object sender, RoutedEventArgs e) { var fc = new FontChooser { SelectedFontFamily = titlefontlabel.FontFamily, SelectedFontSize = titlefontlabel.FontSize, SelectedFontStyle = titlefontlabel.FontStyle, SelectedFontWeight = titlefontlabel.FontWeight }; var dr = fc.ShowDialog(); if (dr != true) { return; } titlefontlabel.FontFamily = fc.SelectedFontFamily; titlefontlabel.FontSize = fc.SelectedFontSize; titlefontlabel.FontStyle = fc.SelectedFontStyle; titlefontlabel.FontWeight = fc.SelectedFontWeight; Properties.Settings.Default.DefaultTitleFontFamily = fc.SelectedFontFamily.ToString(); Properties.Settings.Default.DefaultTitleFontSize = fc.SelectedFontSize; Properties.Settings.Default.DefaultTitleFontStyle = FontConversions.FontStyleToString(fc.SelectedFontStyle); Properties.Settings.Default.DefaultTitleFontWeight = FontConversions.FontWeightToString(fc.SelectedFontWeight); titlefontlabel.Content = string.Format("{0}, {1}pt, {2}, {3}", titlefontlabel.FontFamily, titlefontlabel.FontSize, titlefontlabel.FontStyle, titlefontlabel.FontWeight); }
void font_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; if (button == null) return; TextBlock t = button.Content as TextBlock; if (t == null) return; Action<TextBlock> func = button.Tag as Action<TextBlock>; if (func == null) return; var dlg = new FontChooser(); dlg.Owner = MainWindow.mainWindow; dlg.SetPropertiesFromObject(t); dlg.PreviewSampleText = "The quick brown fox jumps over the lazy white dog."; if (dlg.ShowDialog() == true) { dlg.ApplyPropertiesToObject(t); t.Text = GetFontName(t); func(t); } }
internal void SetTarget(SupplementProcessor.UserControls.Table target) { Vector2DPosition.ValueInPixel = target.GetLocation(); XLSColumn.UpdateList(MainWindow.instance.LayoutProperties.LayoutType); SelectListItem(XLSColumn.XLSColumsList, target.XlsColumn); FontChooser.SetTarget(target); FontChooser2.SetTarget(target.TextFontFamily, target.TextFontSize, target.TextFontStyle, target.TextFontWeight); }
internal void SetTarget(IPropertiesTarget target) { TextCaption = target.SpanText; Vector2DPosition.ValueInPixel = target.GetLocation(); XLSColumn.UpdateList(MainWindow.instance.LayoutProperties.LayoutType); SelectListItem(XLSColumn.XLSColumsList, target.XlsColumn); FontChooser.SetTarget(target); }
private void btnFont_Click(object sender, RoutedEventArgs e) { if (_currentNoteControl != null) { var form = new FontChooser(); form.Owner = this.FindParentWindow(); form.WindowStartupLocation = WindowStartupLocation.CenterOwner; if (form.ShowDialog().ValueOrFalse()) { form.ApplyPropertiesToTextSelection(_currentNoteControl.txtNote.Selection); } } }
public void Execute(object parameter) { UserTagView tag = Exceptions.CheckArgumentNull((UserTagView)parameter, "parameter"); FontChooser chooser = new FontChooser { FontDescriptor = (FontDescriptor)tag.Font }; if (chooser.ShowDialog() == true) { tag.Font = (FontDescriptorView)chooser.FontDescriptor; } }
private void button1_Click(object sender, EventArgs e) { FontChooser fontchooser = new FontChooser(); ElementHost.EnableModelessKeyboardInterop(fontchooser); WindowInteropHelper helper = new WindowInteropHelper(fontchooser); helper.Owner = this.Handle; fontchooser.WindowStartupLocation = WindowStartupLocation.CenterOwner; if (fontchooser.ShowDialog() == true) { this.textBox1.Font = fontchooser.myfont; this.textBox1.ForeColor = fontchooser._color; } }
private void OnFontChange(object sender, RoutedEventArgs e) { FontChooser fontChooser = new FontChooser(); fontChooser.Owner = this; fontChooser.SetPropertiesFromObject(FontName); fontChooser.PreviewSampleText = FontName.Text; if (fontChooser.ShowDialog().Value) { fontChooser.ApplyPropertiesToObject(FontName); fontChooser.ApplyPropertiesToObject(SpecialFontTextBox); fontChooser.ApplyPropertiesToObject(CurrencySpecialFontSymbolLeft); fontChooser.ApplyPropertiesToObject(CurrencySpecialFontSymbol); } }
private void SelectFont(TextBlock control) { var fontDlg = new FontChooser { SelectedFontFamily = control.FontFamily, SelectedFontSize = control.FontSize, SelectedFontStyle = control.FontStyle, SelectedFontWeight = control.FontWeight, Owner = this }; if (fontDlg.ShowDialog() == true) { control.FontFamily = fontDlg.SelectedFontFamily; control.FontSize = fontDlg.SelectedFontSize; control.FontStyle = fontDlg.SelectedFontStyle; control.FontWeight = fontDlg.SelectedFontWeight; control.TextDecorations = fontDlg.SelectedTextDecorations; var points = GraphicsUtils.PixelsToPoints(this, control.FontSize); control.Text = String.Format("{0}, {1} pt", control.FontFamily.Source, points); setDirty(); } }
Button AddFontRow(string k, TextBlock text) { TextBlock b1 = new TextBlock(); b1.Text = k; b1.Width = 150; b1.HorizontalAlignment = HorizontalAlignment.Left; b1.VerticalAlignment = VerticalAlignment.Center; Grid.SetRow(b1, 0); Grid.SetColumn(b1, 0); Button b2 = new Button(); b2.HorizontalAlignment = HorizontalAlignment.Left; b2.VerticalAlignment = VerticalAlignment.Center; b2.MinWidth = 100; TextBlock b3 = new TextBlock(); b3.Text = GetFontName(text); b2.Content = b3; FontChooser.TransferFontProperties(text, b3); Grid.SetRow(b2, 0); Grid.SetColumn(b2, 1); ColumnDefinition colDef1 = new ColumnDefinition(); colDef1.MinWidth = 150; ColumnDefinition colDef2 = new ColumnDefinition(); colDef2.MinWidth = 150; Grid g = new Grid(); g.ColumnDefinitions.Add(colDef1); g.ColumnDefinitions.Add(colDef2); g.Children.Add(b1); g.Children.Add(b2); lb.Items.Add(g); return b2; }
private void titlefontchooserbtn_Click(object sender, RoutedEventArgs e) { var fc = new FontChooser { SelectedFontFamily = titlefontlabel.FontFamily, SelectedFontSize = titlefontlabel.FontSize, SelectedFontStyle = titlefontlabel.FontStyle, SelectedFontWeight = titlefontlabel.FontWeight }; var dr = fc.ShowDialog(); if (dr != true) { return; } titlefontlabel.FontFamily = fc.SelectedFontFamily; titlefontlabel.FontSize = fc.SelectedFontSize; titlefontlabel.FontStyle = fc.SelectedFontStyle; titlefontlabel.FontWeight = fc.SelectedFontWeight; titlefontlabel.Content = string.Format("{0}, {1}pt, {2}, {3}", titlefontlabel.FontFamily, titlefontlabel.FontSize, titlefontlabel.FontStyle, titlefontlabel.FontWeight); }
private void fontchooserbtn_Click(object sender, RoutedEventArgs e) { var fc = new FontChooser { SelectedFontFamily = fontlabel.FontFamily, SelectedFontSize = fontlabel.FontSize, SelectedFontStyle = fontlabel.FontStyle, SelectedFontWeight = fontlabel.FontWeight }; var dr = fc.ShowDialog(); if (dr != true) return; fontlabel.FontFamily = fc.SelectedFontFamily; fontlabel.FontSize = fc.SelectedFontSize; fontlabel.FontStyle = fc.SelectedFontStyle; fontlabel.FontWeight = fc.SelectedFontWeight; fontlabel.Content = string.Format("{0}, {1}pt, {2}, {3}", fontlabel.FontFamily, fontlabel.FontSize, fontlabel.FontStyle, fontlabel.FontWeight); }
private void titlefontchooserbtn_Click(object sender, RoutedEventArgs e) { var fc = new FontChooser { SelectedFontFamily = titlefontlabel.FontFamily, SelectedFontSize = titlefontlabel.FontSize, SelectedFontStyle = titlefontlabel.FontStyle, SelectedFontWeight = titlefontlabel.FontWeight }; var dr = fc.ShowDialog(); if (dr != true) return; titlefontlabel.FontFamily = fc.SelectedFontFamily; titlefontlabel.FontSize = fc.SelectedFontSize; titlefontlabel.FontStyle = fc.SelectedFontStyle; titlefontlabel.FontWeight = fc.SelectedFontWeight; Properties.Settings.Default.DefaultTitleFontFamily = fc.SelectedFontFamily.ToString(); Properties.Settings.Default.DefaultTitleFontSize = fc.SelectedFontSize; Properties.Settings.Default.DefaultTitleFontStyle = FontConversions.FontStyleToString(fc.SelectedFontStyle); Properties.Settings.Default.DefaultTitleFontWeight = FontConversions.FontWeightToString(fc.SelectedFontWeight); titlefontlabel.Content = string.Format("{0}, {1}pt, {2}, {3}", titlefontlabel.FontFamily, titlefontlabel.FontSize, titlefontlabel.FontStyle, titlefontlabel.FontWeight); }