private void menuColor_Click(object sender, SourcedEventArgs e) { C1RadialColorItem item = e.Source as C1RadialColorItem; if (item != null) { if (colorMenu.SelectedIndex == 1) { // apply foreground and update selected item color UpdateForeground(item.Brush); // update Tag so that to show correct color under the Icon and use it at clicks on the Color item in menu root fontColorItem.Tag = item.Brush; if (item.ParentItem != null) { // keep index, so that we can use it at switching context _selectedForegroundColors[item.GroupName] = ((ItemsControl)item.ParentItem).Items.IndexOf(item); } } else if (colorMenu.SelectedIndex == 2) { // apply background and update selected item color UpdateBackground(item.Brush); // update Tag so that to show correct color under the Icon and use it at clicks on the Color item in menu root textHighlightItem.Tag = item.Brush; if (item.ParentItem != null) { // keep index, so that we can use it at switching context _selectedBackroundColors[item.GroupName] = ((ItemsControl)item.ParentItem).Items.IndexOf(item); } } } }
private void menuFormatPainter_Click(object sender, SourcedEventArgs e) { rtb.FormatCopy(); IsFormatPainterChecked = true; rtb.MouseSelectionCompleted -= OnMouseSelection; rtb.MouseSelectionCompleted += OnMouseSelection; }
// apply a predefined view void mi_Click(object sender, SourcedEventArgs e) { var mi = sender as C1MenuItem; var viewDef = mi.Tag as string; txtStatus.Text = mi.Header.ToString(); olapPage.ViewDefinition = viewDef; }
private void menuSubscript_Click(object sender, SourcedEventArgs e) { // subscript using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; foreach (var ran in range.EditRanges) { var isSub = ran.EditRanges.All(r => (C1VerticalAlignment.Sub).Equals(r.InlineAlignment)); var isSuper = ran.EditRanges.All(r => (C1VerticalAlignment.Super).Equals(r.InlineAlignment)); if (isSub) { ran.InlineAlignment = C1VerticalAlignment.Baseline; GrowFont(4); } else { ran.InlineAlignment = C1VerticalAlignment.Sub; if (!isSuper) { ShrinkFont(4); } } } } }
// apply a predefined view void mi_Click(object sender, SourcedEventArgs e) { var mi = sender as C1MenuItem; var viewDef = mi.Tag as string; _c1OlapPage.ViewDefinition = viewDef; }
private void menuInsertTable_Click(object sender, SourcedEventArgs e) { InsertTableTool tableTool = new InsertTableTool(); tableTool.RichTextBox = rtb; tableTool.Show(); }
private void ToggleTabStripPlacement_Click(object sender, SourcedEventArgs e) { sliding.TabStripPlacement = (C1.WPF.Dock)(sliding.TabStripPlacement + 1); if (!Enum.IsDefined(typeof(C1.WPF.Dock), sliding.TabStripPlacement)) { sliding.TabStripPlacement = 0; } }
// apply a predefined view void mi_Click(object sender, SourcedEventArgs e) { var mi = sender as C1MenuItem; var viewDef = mi.Tag as string; txtStatus.Text = mi.Header.ToString(); olapPage.ViewDefinition = viewDef; }
private void menuPaste_Click(object sender, SourcedEventArgs e) { if (!rtb.IsReadOnly) { _skipMenuUpdate = true; // don't update menu on RTB.SelectionChanged event after this operation rtb.ClipboardPaste(); } }
private void listMsgBoxOptions_ItemClick(object sender, SourcedEventArgs e) { var menuItem = (C1MenuItem)e.Source; var selection = (C1MessageBoxButton)menuItem.Header; SelectMessageBoxType(selection); C1MessageBox.Show("", "", _selectedButton); }
private void menuRedo_Click(object sender, SourcedEventArgs e) { if (rtb.DocumentHistory.CanRedo) { _skipMenuUpdate = true; // don't update menu on RTB.SelectionChanged event after this operation rtb.DocumentHistory.Redo(); System.Diagnostics.Debug.WriteLine("Performed Redo"); } }
private void C1MenuItem_Click(object sender, SourcedEventArgs e) { C1MenuItem menu = sender as C1MenuItem; if (SelectedItemChanged != null) { SelectedItemChanged(this, new EventArgs()); } }
private void ToggleWindowMode_Click(object sender, SourcedEventArgs e) { var value = (DockMode)(sliding.DockMode + 1); if (!Enum.IsDefined(typeof(DockMode), value)) { value = 0; } sliding.DockMode = value; }
private void menuStrikethrough_Click(object sender, SourcedEventArgs e) { var isMenuStrikeChecked = rtb.Selection.Runs.Any() && rtb.Selection.Runs.All(r => r.TextDecorations != null && r.TextDecorations.Contains(C1TextDecorations.Strikethrough[0])); var value = isMenuStrikeChecked ? null : C1TextDecorations.Strikethrough; using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { foreach (var run in range.Runs) { var collection = new C1TextDecorationCollection(); if (value == null) { foreach (var decoration in run.TextDecorations) { collection.Add(decoration); } collection.Remove(C1TextDecorations.Strikethrough[0]); if (collection.Count == 0) { collection = null; } } else if (run.TextDecorations == null) { collection.Add(value[0]); } else if (!run.TextDecorations.Contains(value[0])) { foreach (var decoration in run.TextDecorations) { collection.Add(decoration); } collection.Add(value[0]); } else { continue; } run.TextDecorations = null; run.TextDecorations = collection; } } rtb.Focus(); } }
private void menuCut_Click(object sender, SourcedEventArgs e) { if (rtb.IsReadOnly) { rtb.ClipboardCopy(); } else { _skipMenuUpdate = true; // don't update menu on RTB.SelectionChanged event after this operation rtb.ClipboardCut(); } }
private void tableMenuUnmergeCells_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; range.UnmergeCell(); rtb.Selection = new C1TextRange(range.Start); rtb.Focus(); } }
private void tableMenuInsertBelow_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; range.InsertRowsBelow(); rtb.Selection = new C1TextRange(range.Start); rtb.Focus(); } }
private void fontSize_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; rtb.Selection.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { r.FontSize = (sender as C1RadialNumericItem).Value; } } }
private void tableMenuMergeCells_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; var newCell = range.MergeCells(); if (newCell != null) { rtb.Selection = newCell.ContentRange; } rtb.Selection = new C1TextRange(range.Start); rtb.Focus(); } }
private void fontColorItem_Click(object sender, SourcedEventArgs e) { if (contextMenu.CurrentItem == contextMenu) { // click on the Color item in the menu root UpdateForeground(fontColorItem.Tag as Brush); } else { // update selected indices according to the context orangeItem.SelectedIndex = _selectedForegroundColors["Orange"]; redItem.SelectedIndex = _selectedForegroundColors["Red"]; greenItem.SelectedIndex = _selectedForegroundColors["Green"]; blueItem.SelectedIndex = _selectedForegroundColors["Blue"]; grayItem.SelectedIndex = _selectedForegroundColors["Gray"]; } }
private void menuClear_Click(object sender, SourcedEventArgs e) { _skipMenuUpdate = true; using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; // clear foreground and background colors rtb.Selection.InlineBackground = null; rtb.Selection.Foreground = rtb.Foreground; // clear font rtb.Selection.FontWeight = FontWeights.Normal; rtb.Selection.FontStyle = FontStyles.Normal; rtb.Selection.TextDecorations = null; } }
private void menuItalic_Click(object sender, SourcedEventArgs e) { var value = rtb.Selection.EditRanges.All(r => (FontStyles.Italic).Equals(r.FontStyle)) ? FontStyles.Normal : FontStyles.Italic; if (rtb != null) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { r.FontStyle = value; } rtb.Focus(); } } }
private void contextMenu_ItemClick(object sender, SourcedEventArgs e) { C1RadialMenuItem item = e.Source as C1RadialMenuItem; if (item is C1RadialColorItem) { this.text.Foreground = ((C1RadialColorItem)item).Brush; txt.Text = Strings.ContextMenuItemClickTB + " " + ((C1RadialColorItem)item).Color.ToString(); } else if (item is C1RadialNumericItem) { txt.FontSize = ((C1RadialNumericItem)item).Value; txt.Text = Strings.ContextMenuItemClickTB + " " + ((C1RadialNumericItem)item).Value.ToString(); } else { txt.Text = Strings.ContextMenuItemClickTB + " " + (item.Header ?? item.Name).ToString(); } }
private void tree_ItemClick(object sender, SourcedEventArgs e) { var treeViewItem = e.Source as C1TreeViewItem; if (treeViewItem != null) { var item = treeViewItem.Header as FeatureDescription; if (item != null) { if (item.SubFeatures != null && item.SubFeatures.Count() > 0) { return; } splitter.IsPaneOpen = false; frame.Navigate(typeof(SamplesPage), new NavigationParameter(item, navigationHelper)); } } }
private void OnConditionalFormattingItemClick(object sender, SourcedEventArgs e) { Point condition = (Point)(e.Source as C1MenuItem).CommandParameter; foreach (var row in flexGrid.Rows) { if (row.DataItem is Product product) { var discount = product.Discount; if (discount > condition.X / 100 && discount < condition.Y / 100) { if (row.Background == null) { row.Background = new SolidColorBrush(Colors.LightSkyBlue); } else { row.Background = null; } } } } }
private void menuNumericList_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; // check if selection is already a list var isChecked = range.EditRanges.All(r => docs.TextMarkerStyle.Decimal.Equals(GetMarkerStyle(r))); range.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { if (isChecked) { // undo list range.UndoList(); } else { // make number list range.MakeList(docs.TextMarkerStyle.Decimal); } } } }
private void C1MenuItem_Click(object sender, SourcedEventArgs e) { C1MenuItem menu = sender as C1MenuItem; }
private void mnuCompleteAllAction_Click(object sender, SourcedEventArgs e) { System.Diagnostics.Debug.WriteLine("mnuCompleteAllAction_Click"); SelectAllClickHandler.BulkComplete(); }
private void tableMenuUnmergeCells_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; range.UnmergeCell(); rtb.Selection = new C1TextRange(range.Start); rtb.Focus(); } }
private void tableMenuInsertRight_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; range.InsertColumnsRight(); rtb.Selection = new C1TextRange(range.Start); rtb.Focus(); } }
private void tableMenuAlignCenterVertical_Click(object sender, SourcedEventArgs e) { rtb.Selection.VerticalAlignment = C1VerticalAlignment.Middle; }
private void menuUnderline_Click(object sender, SourcedEventArgs e) { var isMenuUnderlineChecked = rtb.Selection.Runs.Any() && rtb.Selection.Runs.All(r => r.TextDecorations != null && r.TextDecorations.Contains(C1TextDecorations.Underline[0])); var value = isMenuUnderlineChecked ? null : C1TextDecorations.Underline; using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { foreach (var run in range.Runs) { var collection = new C1TextDecorationCollection(); if (value == null) { foreach (var decoration in run.TextDecorations) collection.Add(decoration); collection.Remove(C1TextDecorations.Underline[0]); if (collection.Count == 0) collection = null; } else if (run.TextDecorations == null) { collection.Add(value[0]); } else if (!run.TextDecorations.Contains(value[0])) { foreach (var decoration in run.TextDecorations) collection.Add(decoration); collection.Add(value[0]); } else { continue; } run.TextDecorations = null; run.TextDecorations = collection; } } rtb.Focus(); } }
private void menuPaste_Click(object sender, SourcedEventArgs e) { if (!rtb.IsReadOnly) { _skipMenuUpdate = true; // don't update menu on RTB.SelectionChanged event after this operation rtb.ClipboardPaste(); } }
private void menuColor_Click(object sender, SourcedEventArgs e) { C1RadialColorItem item = e.Source as C1RadialColorItem; if (item != null) { if (colorMenu.SelectedIndex == 1) { // apply foreground and update selected item color UpdateForeground(item.Brush); // update Tag so that to show correct color under the Icon and use it at clicks on the Color item in menu root fontColorItem.Tag = item.Brush; if (item.ParentItem != null) { // keep index, so that we can use it at switching context _selectedForegroundColors[item.GroupName] = ((ItemsControl)item.ParentItem).Items.IndexOf(item); } } else if (colorMenu.SelectedIndex == 2) { // apply background and update selected item color UpdateBackground(item.Brush); // update Tag so that to show correct color under the Icon and use it at clicks on the Color item in menu root textHighlightItem.Tag = item.Brush; if (item.ParentItem != null) { // keep index, so that we can use it at switching context _selectedBackroundColors[item.GroupName] = ((ItemsControl)item.ParentItem).Items.IndexOf(item); } } } }
private void menuClear_Click(object sender, SourcedEventArgs e) { _skipMenuUpdate = true; using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; // clear foreground and background colors rtb.Selection.InlineBackground = null; rtb.Selection.Foreground = rtb.Foreground; // clear font rtb.Selection.FontWeight = FontWeights.Normal; rtb.Selection.FontStyle = FontStyles.Normal; rtb.Selection.TextDecorations = null; } }
private void mnuNotApplicableSelected_Click(object sender, SourcedEventArgs e) { SelectAllClickHandler.BulkNotApplicable(); }
private void menuTabs_ItemClick(object sender, SourcedEventArgs e) { MenuItem item = e.Source as MenuItem; if (item.Header.Equals("Field List")) { if (item.IsChecked == true) { TabFieldList.Visibility = System.Windows.Visibility.Visible; var parent = FindParentTab(TabFieldList); if (parent != null) { parent.Visibility = System.Windows.Visibility.Visible; parent.DockMode = DockMode.Docked; } else { TabSecondary.Items.Add(TabFieldList); } } else { TabFieldList.Visibility = System.Windows.Visibility.Collapsed; } } else if (item.Header.Equals("Pivot Grid")) { if (item.IsChecked == true) { TabPivotGrid.Visibility = System.Windows.Visibility.Visible; var parent = FindParentTab(TabPivotGrid); if (parent != null) { parent.Visibility = System.Windows.Visibility.Visible; parent.DockMode = DockMode.Docked; } else { TabMain.Items.Add(TabPivotGrid); } } else { TabPivotGrid.Visibility = System.Windows.Visibility.Collapsed; } } if (item.Header.Equals("Chart")) { if (item.IsChecked == true) { TabChart.Visibility = System.Windows.Visibility.Visible; var parent = FindParentTab(TabChart); if (parent != null) { parent.Visibility = System.Windows.Visibility.Visible; parent.DockMode = DockMode.Docked; } else { TabMain.Items.Add(TabChart); } } else { TabChart.Visibility = System.Windows.Visibility.Collapsed; } } }
private void C1TreeView_ItemClicked(object sender, SourcedEventArgs e) { UpdateSelection(); }
private void menuTabs_ItemClick(object sender, SourcedEventArgs e) { MenuItem item = e.Source as MenuItem; if (item.Header.Equals("Field List")) { if (item.IsChecked == true) { TabFieldList.Visibility = System.Windows.Visibility.Visible; var parent = FindParentTab(TabFieldList); if (parent != null) { parent.Visibility = System.Windows.Visibility.Visible; parent.DockMode = DockMode.Docked; } else { TabSecondary.Items.Add(TabFieldList); } } else { TabFieldList.Visibility = System.Windows.Visibility.Collapsed; } } else if (item.Header.Equals("Pivot Grid")) { if (item.IsChecked == true) { TabPivotGrid.Visibility = System.Windows.Visibility.Visible; var parent = FindParentTab(TabPivotGrid); if (parent != null) { parent.Visibility = System.Windows.Visibility.Visible; parent.DockMode = DockMode.Docked; } else { TabMain.Items.Add(TabPivotGrid); } } else { TabPivotGrid.Visibility = System.Windows.Visibility.Collapsed; } } if (item.Header.Equals("Chart")) { if (item.IsChecked == true) { TabChart.Visibility = System.Windows.Visibility.Visible; var parent = FindParentTab(TabChart); if (parent != null) { parent.Visibility = System.Windows.Visibility.Visible; parent.DockMode = DockMode.Docked; } else { TabMain.Items.Add(TabChart); } } else { TabChart.Visibility = System.Windows.Visibility.Collapsed; } } }
private void _flexChartContextMenu_ItemClick(object sender, SourcedEventArgs e) { al.Annotations.Remove(al.SelectedAnnotation); }
private void menuNumericList_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; // check if selection is already a list var isChecked = range.EditRanges.All(r => docs.TextMarkerStyle.Decimal.Equals(GetMarkerStyle(r))); range.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { if (isChecked) { // undo list range.UndoList(); } else { // make number list range.MakeList(docs.TextMarkerStyle.Decimal); } } } }
private void menuCopy_Click(object sender, SourcedEventArgs e) { rtb.ClipboardCopy(); rtb_SelectionChanged(null, null); // update menu items }
private void menuSuperscript_Click(object sender, SourcedEventArgs e) { // superscript using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; foreach (var ran in range.EditRanges) { var isSub = ran.EditRanges.All(r => (C1VerticalAlignment.Sub).Equals(r.InlineAlignment)); var isSuper = ran.EditRanges.All(r => (C1VerticalAlignment.Super).Equals(r.InlineAlignment)); if (isSuper) { ran.InlineAlignment = C1VerticalAlignment.Baseline; GrowFont(4); } else { ran.InlineAlignment = C1VerticalAlignment.Super; if (!isSub) ShrinkFont(4); } } } }
private void menuCut_Click(object sender, SourcedEventArgs e) { if (rtb.IsReadOnly) rtb.ClipboardCopy(); else { _skipMenuUpdate = true; // don't update menu on RTB.SelectionChanged event after this operation rtb.ClipboardCut(); } }
private void menuUndo_Click(object sender, SourcedEventArgs e) { if (rtb.DocumentHistory.CanUndo) { _skipMenuUpdate = true; // don't update menu on RTB.SelectionChanged event after this operation rtb.DocumentHistory.Undo(); System.Diagnostics.Debug.WriteLine("Performed Undo"); rtb.Focus(); } }
private void menuFormatPainter_Click(object sender, SourcedEventArgs e) { rtb.FormatCopy(); IsFormatPainterChecked = true; rtb.MouseSelectionCompleted -= OnMouseSelection; rtb.MouseSelectionCompleted += OnMouseSelection; }
private void tableMenuAlignTop_Click(object sender, SourcedEventArgs e) { rtb.Selection.VerticalAlignment = C1VerticalAlignment.Top; }
private void menuInsertHyperlink_Click(object sender, SourcedEventArgs e) { ShowInsertHyperlinkDialog(); }
private void tableMenuMergeCells_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; var newCell = range.MergeCells(); if (newCell != null) { rtb.Selection = newCell.ContentRange; } rtb.Selection = new C1TextRange(range.Start); rtb.Focus(); } }
private void menuInsertPicture_Click(object sender, SourcedEventArgs e) { ShowInsertImageDialog(); }
private void textHighlightItem_Click(object sender, SourcedEventArgs e) { if (contextMenu.CurrentItem == contextMenu) { // click on the Color item in the menu root UpdateBackground(textHighlightItem.Tag as Brush); } else { // update selected indices according to the context orangeItem.SelectedIndex = _selectedBackroundColors["Orange"]; redItem.SelectedIndex = _selectedBackroundColors["Red"]; greenItem.SelectedIndex = _selectedBackroundColors["Green"]; blueItem.SelectedIndex = _selectedBackroundColors["Blue"]; grayItem.SelectedIndex = _selectedBackroundColors["Gray"]; } }
private void menuInsertTable_Click(object sender, SourcedEventArgs e) { InsertTableTool tableTool = new InsertTableTool(); tableTool.RichTextBox = rtb; tableTool.Show(); }
private void contextMenu_ItemOpened(object sender, SourcedEventArgs e) { C1RadialMenuItem item = e.Source as C1RadialMenuItem; txt.Text = Strings.RadialMenuItemOpenedTB + " " + (item.Header ?? item.Name).ToString(); }
private void menuItalic_Click(object sender, SourcedEventArgs e) { var value = rtb.Selection.EditRanges.All(r => (FontStyles.Italic).Equals(r.FontStyle)) ? FontStyles.Normal : FontStyles.Italic; if (rtb != null) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; range.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { r.FontStyle = value; } rtb.Focus(); } } }
private void fontSize_Click(object sender, SourcedEventArgs e) { using (new DocumentHistoryGroup(rtb.DocumentHistory)) { var range = rtb.Selection; rtb.Selection.TrimRuns(); rtb.Selection = range; foreach (var r in range.EditRanges) { r.FontSize = (sender as C1RadialNumericItem).Value; } } }
private void menuJustify_Click(object sender, SourcedEventArgs e) { rtb.Selection.TextAlignment = C1TextAlignment.Justify; }
// apply a predefined view void mi_Click(object sender, SourcedEventArgs e) { var mi = sender as C1MenuItem; var viewDef = mi.Tag as string; _c1OlapPage.ViewDefinition = viewDef; }
private void menuAlignCenter_Click(object sender, SourcedEventArgs e) { rtb.Selection.TextAlignment = C1TextAlignment.Center; }
private void C1TreeView_ItemClicked(object sender, SourcedEventArgs e) { UpdateSelection(); }
private void menuAlignRight_Click(object sender, SourcedEventArgs e) { rtb.Selection.TextAlignment = C1TextAlignment.Right; }