private void MenuItemaAddTable_Click(object sender, RoutedEventArgs e) { var window = new TablePropertiesWindow(); if (window.ShowDialog() == true) { AddTableElement(window); } }
private void MenuItemaAddTable_Click(object sender, RoutedEventArgs e) { var window = new TablePropertiesWindow(); if (window.ShowDialog() == true) { AddTableElement(window); PushCommandToHistory(new AddCommand(this, m_LoadedCanvasItems.Last())); } }
private void MenuItemShowProperties_Click(object sender, RoutedEventArgs e) { //MessageBox.Show("Not implemented!", "Notice", MessageBoxButton.OK, MessageBoxImage.Asterisk); var window = new TablePropertiesWindow(); window.SetTarget(this); window.RowCount = RowCount; window.RowHeight = RowHeight; GridLength col0Width = TableGrid.ColumnDefinitions[0].Width, col1Width = TableGrid.ColumnDefinitions[1].Width, col2Width = TableGrid.ColumnDefinitions[2].Width; if (window.ShowDialog() == true) { ActionHistory.Push(new TablePropertiesCommand(this)); Canvas.SetLeft(this, window.Vector2DPosition.ValueInPixel.X); Canvas.SetTop(this, window.Vector2DPosition.ValueInPixel.Y); //SpanContent.Text = window.TextCaption; RowCount = window.RowCount; RowHeight = window.RowHeight; XlsColumn = (string)window.XLSColumn.XLSColumsList.SelectedValue; SpanFontFamily = window.FontChooser.SelectedFontFamily; SpanFontSize = Helper.ToEmSize(window.FontChooser.SelectedFontSize, MainWindow.DpiY); SpanFontWeight = window.FontChooser.SelectedFontWeight; SpanFontStyle = window.FontChooser.SelectedFontStyle; TextFontFamily = window.FontChooser2.SelectedFontFamily; TextFontSize = Helper.ToEmSize(window.FontChooser2.SelectedFontSize, MainWindow.DpiY); TextFontWeight = window.FontChooser2.SelectedFontWeight; TextFontStyle = window.FontChooser2.SelectedFontStyle; TableGrid.Children.Clear(); TableGrid.ColumnDefinitions.Clear(); TableGrid.RowDefinitions.Clear(); UpdateTableDefinition(window.RowCount, window.RowHeight, col0Width, col1Width, col2Width); FillTable(); if (LayoutWindow.instance != null) { LayoutWindow.instance.IsChanged = true; } } }
void AddTableElement(TablePropertiesWindow window) { var control = new Table(); Canvas.SetLeft(control, window.Vector2DPosition.ValueInPixel.X); Canvas.SetTop(control, window.Vector2DPosition.ValueInPixel.Y); control.XlsColumn = (string)window.XLSColumn.XLSColumsList.SelectedValue; control.TableFontFamily = window.FontChooser.SelectedFontFamily; control.TableFontSize = Helper.ToEmSize(window.FontChooser.SelectedFontEmSize, MainWindow.DpiY); control.TableFontStyle = window.FontChooser.SelectedFontStyle; control.TableFontWeight = window.FontChooser.SelectedFontWeight; control.TableFontStretch = window.FontChooser.SelectedFontStretch; control.Initialize(window.RowCount, window.RowHeight, new GridLength(100, GridUnitType.Star), new GridLength(3, GridUnitType.Pixel), new GridLength(45, GridUnitType.Star)); AddCanvasElement(control); }