public MemberPropertiesControl() { TabCtrl = new RanetTabControl(); PropertiesCtrl = new PropertiesListControl(); TabItem PropertiesTab = new TabItem(); PropertiesTab.Header = Localization.Properties; PropertiesTab.Style = TabCtrl.Resources["TabControlOutputItem"] as Style; PropertiesTab.Content = PropertiesCtrl; TabCtrl.TabCtrl.Items.Add(PropertiesTab); PropertiesTab.Header = Localization.Properties; TabToolBar toolBar = TabCtrl.ToolBar; if (toolBar != null) { RanetToolBarButton copyBtn = new RanetToolBarButton(); ToolTipService.SetToolTip(copyBtn, Localization.CopyToClipboard_ToolTip); copyBtn.Content = UiHelper.CreateIcon(UriResources.Images.Copy16); toolBar.Stack.Children.Add(copyBtn); copyBtn.Click += new RoutedEventHandler(CopyButton_Click); } this.Content = TabCtrl; }
public OperationItemControl(OperationTypes operation, bool isRoot) { InitializeComponent(); RanetHotButton add = new RanetHotButton() { Margin = new Thickness(5, 0, 0, 0) }; add.Click += new RoutedEventHandler(add_Click); add.Width = 18; add.Height = 18; add.Content = UiHelper.CreateIcon(UriResources.Images.AddHot16); LayoutRoot.Children.Add(add); Grid.SetColumn(add, 1); m_IsRoot = isRoot; operationControl.HorizontalContentAlignment = HorizontalAlignment.Stretch; operationControl.SelectionChanged += new SelectionChangedEventHandler(operationControl_SelectionChanged); operationControl.DropDownClosed += new EventHandler(operationControl_DropDownClosed); InitItems(); if (operationControl.Items.Count > 0) { operationControl.SelectedIndex = 0; } }
public XYNavigator() { LayoutRoot = new Grid(); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); m_UpButton = new RanetButton() { Width = 18, Height = 18 }; m_UpButton.Content = UiHelper.CreateIcon(UriResources.Images.Up16); m_UpButton.Click += new RoutedEventHandler(m_UpButton_Click); m_DownButton = new RanetButton() { Width = 18, Height = 18 }; m_DownButton.Content = UiHelper.CreateIcon(UriResources.Images.Down16); m_DownButton.Click += new RoutedEventHandler(m_DownButton_Click); m_LeftButton = new RanetButton() { Width = 18, Height = 18 }; m_LeftButton.Content = UiHelper.CreateIcon(UriResources.Images.Left16); m_LeftButton.Click += new RoutedEventHandler(m_LeftButton_Click); m_RightButton = new RanetButton() { Width = 18, Height = 18 }; m_RightButton.Content = UiHelper.CreateIcon(UriResources.Images.Right16); m_RightButton.Click += new RoutedEventHandler(m_RightButton_Click); RefreshButtonsAlignment(); this.Content = LayoutRoot; }
public AreaItemControl() { LayoutRoot = new Grid(); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); Border border = new Border(); border.BorderBrush = new SolidColorBrush(Colors.DarkGray); border.BorderThickness = new Thickness(1); border.Padding = new Thickness(2); border.Child = LayoutRoot; m_ItemCtrl = new HeaderControl(); LayoutRoot.Children.Add(m_ItemCtrl); m_MoveUpButton = new RanetHotButton(); m_MoveUpButton.Click += new RoutedEventHandler(m_MoveUpButton_Click); m_MoveUpButton.Width = 18; m_MoveUpButton.Height = 18; m_MoveUpButton.Content = UiHelper.CreateIcon(UriResources.Images.Up16); LayoutRoot.Children.Add(m_MoveUpButton); Grid.SetColumn(m_MoveUpButton, 2); m_MoveDownButton = new RanetHotButton(); m_MoveDownButton.Click += new RoutedEventHandler(m_MoveDownButton_Click); m_MoveDownButton.Width = 18; m_MoveDownButton.Height = 18; m_MoveDownButton.Content = UiHelper.CreateIcon(UriResources.Images.Down16); LayoutRoot.Children.Add(m_MoveDownButton); Grid.SetColumn(m_MoveDownButton, 3); m_RemoveButton = new RanetHotButton(); m_RemoveButton.Click += new RoutedEventHandler(m_RemoveButton_Click); m_RemoveButton.Width = 18; m_RemoveButton.Height = 18; m_RemoveButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveHot16); LayoutRoot.Children.Add(m_RemoveButton); Grid.SetColumn(m_RemoveButton, 4); this.Content = border; this.MouseLeave += new MouseEventHandler(OnMouseLeave); this.MouseEnter += new MouseEventHandler(OnMouseEnter); }
protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem) { if (!string.IsNullOrEmpty(this.Resource) && !string.IsNullOrEmpty(this.CustomResourceFormat)) { Image icon = UiHelper.CreateIcon(UriResources.GetImage(String.Format(this.CustomResourceFormat, this.Resource))); return(icon); } if (!string.IsNullOrEmpty(this.Resource)) { if (dataItem is KpiView && Resource == "Status") { Image icon = UiHelper.CreateIcon(UriResources.GetImage(GetKpiIconByPath(this.Resource, (dataItem as KpiView).StatusGraphic))); return(icon); } if (dataItem is KpiView && Resource == "Trend") { Image icon = UiHelper.CreateIcon(UriResources.GetImage(GetKpiIconByPath(this.Resource, (dataItem as KpiView).TrendGraphic))); return(icon); } } TextBlock block = new TextBlock(); block.Margin = new Thickness(4.0); block.VerticalAlignment = VerticalAlignment.Center; block.Text = dataItem.ToString(); return(block); }
public CalculationsEditor() { InitializeComponent(); m_AddCalcMemberButton = new RanetToolBarButton(); m_AddCalcMemberButton.Content = UiHelper.CreateIcon(UriResources.Images.AddMeasure16); m_AddCalcMemberButton.Click += new RoutedEventHandler(m_AddCalcMemberButton_Click); ToolTipService.SetToolTip(m_AddCalcMemberButton, Localization.CalcMemberEditor_AddMember); ToolBar.AddItem(m_AddCalcMemberButton); m_AddNamedSetButton = new RanetToolBarButton(); m_AddNamedSetButton.Content = UiHelper.CreateIcon(UriResources.Images.AddNamedSet16); m_AddNamedSetButton.Click += new RoutedEventHandler(m_AddNamedSetButton_Click); ToolTipService.SetToolTip(m_AddNamedSetButton, Localization.CalcMemberEditor_AddNamedSet); ToolBar.AddItem(m_AddNamedSetButton); m_DeleteCalcMemberButton = new RanetToolBarButton(); m_DeleteCalcMemberButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveCross16); m_DeleteCalcMemberButton.Click += new RoutedEventHandler(m_DeleteCalcMemberButton_Click); m_DeleteCalcMemberButton.IsEnabled = false; ToolTipService.SetToolTip(m_DeleteCalcMemberButton, Localization.CalcMemberEditor_DeleteMember); ToolBar.AddItem(m_DeleteCalcMemberButton); m_ClearButton = new RanetToolBarButton(); m_ClearButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveAllCross16); m_ClearButton.Click += new RoutedEventHandler(m_ClearButton_Click); m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0; ToolTipService.SetToolTip(m_ClearButton, Localization.CalcMemberEditor_Clear); ToolBar.AddItem(m_ClearButton); MembersList.SelectionChanged += new EventHandler <SelectionChangedEventArgs <CalculationInfoBase> >(MembersList_SelectionChanged); MemberCtrl.InnerEditStart += new EventHandler(MemberCtrl_InnerEditStart); MemberCtrl.InnerEditEnd += new EventHandler(MemberCtrl_InnerEditEnd); MemberCtrl.EditEnd += new EventHandler(MemberCtrl_EditEnd); SetCtrl.EditEnd += new EventHandler(MemberCtrl_EditEnd); FormatStrings.Add("#"); FormatStrings.Add("#,#"); FormatStrings.Add("#,#.00"); FormatStrings.Add("$#,#;-$#,#;"); FormatStrings.Add("$#,#.00;-$#,#.00;"); FormatStrings.Add("Standard"); FormatStrings.Add("Short Date"); FormatStrings.Add("Short Time"); FormatStrings.Add("Percent"); CubeBrowser.DragNodes = true; CubeBrowser.DragStarted += new EventHandler <DragNodeArgs <DragStartedEventArgs> >(CubeBrowser_DragStarted); CubeBrowser.DragDelta += new EventHandler <DragNodeArgs <DragDeltaEventArgs> >(CubeBrowser_DragDelta); CubeBrowser.DragCompleted += new EventHandler <DragNodeArgs <DragCompletedEventArgs> >(CubeBrowser_DragCompleted); }
public FilteredItemControl(Filtered_AreaItemWrapper wrapper, BitmapImage icon) : base(wrapper, icon) { m_FilterButton = new RanetHotButton(); m_FilterButton.Click += new RoutedEventHandler(m_FilterButton_Click); m_FilterButton.Width = 18; m_FilterButton.Height = 18; m_FilterButton.Content = UiHelper.CreateIcon(UriResources.Images.FiltersArea16); LayoutRoot.Children.Add(m_FilterButton); Grid.SetColumn(m_FilterButton, 1); Refresh(); }
public CustomCellConditionsEditor() { InitializeComponent(); lblStyleDetails.Text = Localization.StyleDetails_Label; lblStyles.Text = Localization.Styles_Label; DescriptorsList.SelectionChanged += new EventHandler <SelectionChangedEventArgs <CellConditionsDescriptor> >(DescriptorsList_SelectionChanged); DescriptorDetails.EditEnd += new EventHandler(DescriptorDetails_EditEnd); AddButton = new RanetToolBarButton(); AddButton.Content = UiHelper.CreateIcon(UriResources.Images.New16); AddButton.Click += new RoutedEventHandler(m_AddButton_Click); ToolTipService.SetToolTip(AddButton, Localization.Toolbar_NewButton_ToolTip); ToolBar.AddItem(AddButton); DeleteButton = new RanetToolBarButton(); DeleteButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveCross16); DeleteButton.Click += new RoutedEventHandler(m_DeleteButton_Click); DeleteButton.IsEnabled = false; ToolTipService.SetToolTip(DeleteButton, Localization.Toolbar_DeleteButton_ToolTip); ToolBar.AddItem(DeleteButton); DeleteAllButton = new RanetToolBarButton(); DeleteAllButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveAllCross16); DeleteAllButton.Click += new RoutedEventHandler(m_DeleteAllButton_Click); DeleteAllButton.IsEnabled = false; ToolTipService.SetToolTip(DeleteAllButton, Localization.Toolbar_DeleteAllButton_ToolTip); ToolBar.AddItem(DeleteAllButton); m_ImportButton = new RanetToolBarButton(); m_ImportButton.Content = UiHelper.CreateIcon(UriResources.Images.FileImport16); m_ImportButton.Click += new RoutedEventHandler(m_ImportButton_Click); ToolTipService.SetToolTip(m_ImportButton, Localization.LoadSettings_ToolTip); ToolBar.AddItem(m_ImportButton); m_ExportButton = new RanetToolBarButton(); m_ExportButton.Content = UiHelper.CreateIcon(UriResources.Images.FileExport16); m_ExportButton.Click += new RoutedEventHandler(m_ExportButton_Click); ToolTipService.SetToolTip(m_ExportButton, Localization.SaveSettings_ToolTip); ToolBar.AddItem(m_ExportButton); DescriptorsList.DeleteAllButton_IsEnabledChanged += new DependencyPropertyChangedEventHandler(DescriptorsList_DeleteAllButton_IsEnabledChanged); DescriptorsList.DeleteButton_IsEnabledChanged += new DependencyPropertyChangedEventHandler(DescriptorsList_DeleteButton_IsEnabledChanged); }
public CellPropertiesControl() { InitializeComponent(); PropertiesCtrl = new PropertiesListControl(); TupleCtrl = new CellTupleControl(); TabItem PropertiesTab = new TabItem(); PropertiesTab.Header = Localization.Properties; PropertiesTab.Style = TabCtrl.Resources["TabControlOutputItem"] as Style; PropertiesTab.Content = PropertiesCtrl; TabItem TupleTab = new TabItem(); TupleTab.Header = Localization.Tuple; TupleTab.Style = TabCtrl.Resources["TabControlOutputItem"] as Style; TupleTab.Content = TupleCtrl; TabCtrl.TabCtrl.Items.Add(PropertiesTab); TabCtrl.TabCtrl.Items.Add(TupleTab); TupleCtrl.HierarchyColumn.Width = PropertiesCtrl.PropertyColumnWidth; TupleCtrl.MemberColumn.Width = PropertiesCtrl.ValueColumnWidth; PropertiesTab.Header = Localization.Properties; TupleTab.Header = Localization.Tuple; TabToolBar toolBar = TabCtrl.ToolBar; if (toolBar != null) { RanetToolBarButton copyBtn = new RanetToolBarButton(); ToolTipService.SetToolTip(copyBtn, Localization.CopyToClipboard_ToolTip); copyBtn.Content = UiHelper.CreateIcon(UriResources.Images.Copy16); toolBar.Stack.Children.Add(copyBtn); copyBtn.Click += new RoutedEventHandler(CopyButton_Click); } }
public ValueCopyControl() { Grid LayoutRoot = new Grid(); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.RowDefinitions.Add(new RowDefinition()); Grid Row0_LayoutRoot = new Grid(); Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); Row0_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); Row0_LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()); Row0_LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()); //Row0_LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); // Тип копирования TextBlock Label_CopyType = new TextBlock() { Text = Localization.ValueCopyControl_TypeOfCopying, Margin = new Thickness(0) }; Row0_LayoutRoot.Children.Add(Label_CopyType); Grid.SetRow(Label_CopyType, 0); Grid.SetColumnSpan(Label_CopyType, 2); m_CopyType = new ComboBoxEx(); m_CopyType.Margin = new Thickness(0, 5, 0, 0); ItemControlBase ctrl; ctrl = new ItemControlBase(false); ctrl.Text = Localization.ValueCopyControl_CopyValueFromSource; ctrl.Tag = ValueCopyTypes.CopyValueFromSource; m_CopyType.Combo.Items.Add(ctrl); ctrl = new ItemControlBase(false); ctrl.Text = Localization.ValueCopyControl_DeliveryValuePropotrionalSource; ctrl.Tag = ValueCopyTypes.DeliveryValuePropotrionalSource; m_CopyType.Combo.Items.Add(ctrl); Row0_LayoutRoot.Children.Add(m_CopyType); Grid.SetRow(m_CopyType, 1); Grid.SetColumnSpan(m_CopyType, 2); // Коэффициент TextBlock Label_Coefficient = new TextBlock() { Text = Localization.ValueCopyControl_Сoefficient, Margin = new Thickness(0, 5, 0, 0) }; Row0_LayoutRoot.Children.Add(Label_Coefficient); Grid.SetRow(Label_Coefficient, 2); m_Coefficient = new RichTextBox() { Text = "1", Margin = new Thickness(0, 5, 0, 0) }; Row0_LayoutRoot.Children.Add(m_Coefficient); Grid.SetRow(m_Coefficient, 3); // Значение TextBlock Label_Value = new TextBlock() { Text = Localization.ValueCopyControl_Value, Margin = new Thickness(5, 5, 0, 0) }; Row0_LayoutRoot.Children.Add(Label_Value); Grid.SetRow(Label_Value, 2); Grid.SetColumn(Label_Value, 1); m_Value = new RichTextBox() { Text = "0", Margin = new Thickness(5, 5, 0, 0) }; Row0_LayoutRoot.Children.Add(m_Value); Grid.SetRow(m_Value, 3); Grid.SetColumn(m_Value, 1); m_CopyType.SelectionChanged += new SelectionChangedEventHandler(m_CopyType_SelectionChanged); m_CopyType.Combo.SelectedIndex = 0; LayoutRoot.Children.Add(Row0_LayoutRoot); Grid.SetRow(Row0_LayoutRoot, 1); Grid Row1_LayoutRoot = new Grid(); Row1_LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); Row1_LayoutRoot.RowDefinitions.Add(new RowDefinition()); // Координаты TextBlock Label_Coordinates = new TextBlock() { Text = Localization.ValueCopyControl_Coordinates, Margin = new Thickness(0, 5, 0, 0) }; Row1_LayoutRoot.Children.Add(Label_Coordinates); Grid.SetRow(Label_Coordinates, 0); m_Coordinates = new CoordinatesControl(); m_Coordinates.GetOlapDataLoader += new EventHandler <GetIDataLoaderArgs>(m_Coordinates_GetOlapDataLoader); m_Coordinates.Margin = new Thickness(5); Border coordinates_Border = new Border() { Margin = new Thickness(0, 5, 0, 0), BorderBrush = new SolidColorBrush(Colors.DarkGray), BorderThickness = new Thickness(1) }; coordinates_Border.Child = m_Coordinates; Row1_LayoutRoot.Children.Add(coordinates_Border); Grid.SetRow(coordinates_Border, 1); LayoutRoot.Children.Add(Row1_LayoutRoot); Grid.SetRow(Row1_LayoutRoot, 2); // Ожидание загрузки m_Waiting = new BusyControl(); m_Waiting.Text = Localization.Loading; Row1_LayoutRoot.Children.Add(m_Waiting); Grid.SetRow(m_Waiting, 2); // ТУЛБАР m_ToolBar = new RanetToolBar(); m_ToolBar.Margin = new Thickness(0, 0, 0, 4); LayoutRoot.Children.Add(m_ToolBar); Grid.SetRow(m_ToolBar, 0); UseToolbar = false; RanetToolBarButton m_ImportLayout = new RanetToolBarButton(); m_ImportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileImport16); m_ImportLayout.Click += new RoutedEventHandler(m_ImportLayout_Click); ToolTipService.SetToolTip(m_ImportLayout, Localization.ValueCopyControl_ImportSettings_ToolTip); m_ToolBar.AddItem(m_ImportLayout); RanetToolBarButton m_ExportLayout = new RanetToolBarButton(); m_ExportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileExport16); m_ExportLayout.Click += new RoutedEventHandler(m_ExportLayout_Click); ToolTipService.SetToolTip(m_ExportLayout, Localization.ValueCopyControl_ExportSettings_ToolTip); m_ToolBar.AddItem(m_ExportLayout); IsBusy = false; this.Content = LayoutRoot; }
void RefreshButtonsAlignment() { LayoutRoot.Children.Clear(); // По-умолчанию настройки для положения Center // Расположение: // Y++ // X-- X++ // Y-- int down_col = 1; int down_row = 2; int up_col = 1; int up_row = 0; int left_col = 0; int left_row = 1; int right_col = 2; int right_row = 1; // Картинки для кнопок вверх/вниз if (ReverseVertical) { m_UpButton.Content = UiHelper.CreateIcon(UriResources.Images.Down16); m_DownButton.Content = UiHelper.CreateIcon(UriResources.Images.Up16); } else { m_UpButton.Content = UiHelper.CreateIcon(UriResources.Images.Up16); m_DownButton.Content = UiHelper.CreateIcon(UriResources.Images.Down16); } // Кнопки вверх/вниз switch (m_ButtonsAlignment) { case AligmentType.Center: if (ReverseVertical) { up_row = 2; down_row = 0; } else { up_row = 0; down_row = 2; } break; case AligmentType.Bottom: if (ReverseVertical) { up_row = 2; down_row = 1; } else { up_row = 1; down_row = 2; } break; case AligmentType.Top: if (ReverseVertical) { up_row = 1; down_row = 0; } else { up_row = 0; down_row = 1; } break; case AligmentType.Left: up_col = down_col = 0; if (ReverseVertical) { up_row = 2; down_row = 0; } else { up_row = 0; down_row = 2; } break; case AligmentType.Right: up_col = down_col = 2; if (ReverseVertical) { up_row = 2; down_row = 0; } else { up_row = 0; down_row = 2; } break; } // Кнопки влево/вправо switch (m_ButtonsAlignment) { case AligmentType.Bottom: left_row = 2; right_row = 2; break; case AligmentType.Top: left_row = 0; right_row = 0; break; case AligmentType.Left: left_col = 0; right_col = 1; break; case AligmentType.Right: left_col = 1; right_col = 2; break; } LayoutRoot.Children.Add(m_UpButton); Grid.SetRow(m_UpButton, up_row); Grid.SetColumn(m_UpButton, up_col); LayoutRoot.Children.Add(m_DownButton); Grid.SetRow(m_DownButton, down_row); Grid.SetColumn(m_DownButton, down_col); LayoutRoot.Children.Add(m_LeftButton); Grid.SetRow(m_LeftButton, left_row); Grid.SetColumn(m_LeftButton, left_col); LayoutRoot.Children.Add(m_RightButton); Grid.SetRow(m_RightButton, right_row); Grid.SetColumn(m_RightButton, right_col); RefreshButtonsState(); }
public AreaItemControl() { LayoutRoot = new Grid(); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition()); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); LayoutRoot.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); Border border = new Border(); border.BorderBrush = new SolidColorBrush(Colors.DarkGray); border.BorderThickness = new Thickness(1); border.Padding = new Thickness(2); border.Child = LayoutRoot; m_ItemCtrl = new HeaderControl(); LayoutRoot.Children.Add(m_ItemCtrl); m_MoveUpButton = new RanetHotButton(); m_MoveUpButton.Click += new RoutedEventHandler(m_MoveUpButton_Click); m_MoveUpButton.Width = 18; m_MoveUpButton.Height = 18; m_MoveUpButton.Content = UiHelper.CreateIcon(UriResources.Images.Up16); LayoutRoot.Children.Add(m_MoveUpButton); Grid.SetColumn(m_MoveUpButton, 2); m_MoveDownButton = new RanetHotButton(); m_MoveDownButton.Click += new RoutedEventHandler(m_MoveDownButton_Click); m_MoveDownButton.Width = 18; m_MoveDownButton.Height = 18; m_MoveDownButton.Content = UiHelper.CreateIcon(UriResources.Images.Down16); LayoutRoot.Children.Add(m_MoveDownButton); Grid.SetColumn(m_MoveDownButton, 3); m_RemoveButton = new RanetHotButton(); m_RemoveButton.Click += new RoutedEventHandler(m_RemoveButton_Click); m_RemoveButton.Width = 18; m_RemoveButton.Height = 18; m_RemoveButton.Content = UiHelper.CreateIcon(UriResources.Images.RemoveHot16); LayoutRoot.Children.Add(m_RemoveButton); Grid.SetColumn(m_RemoveButton, 4); this.Content = border; LayoutRoot.AttachContextMenu(p => GetCurrentContextMenu(p)); TooltipManager = new TooltipController(this); TooltipManager.BeforeOpen += new EventHandler <CustomEventArgs <Point> >(TooltipManager_BeforeOpen); TooltipManager.ToolTipContent = ToolTip; }
public ValueCopyDesignerControl() { Grid LayoutRoot = new Grid(); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.RowDefinitions.Add(new RowDefinition()); // ТУЛБАР m_ToolBar = new RanetToolBar(); m_ToolBar.Margin = new Thickness(0, 0, 0, 4); LayoutRoot.Children.Add(m_ToolBar); Grid.SetRow(m_ToolBar, 0); // Контрол копирования данных m_CopyControl = new ValueCopyControl(); m_CopyControl.IsAdminMode = true; LayoutRoot.Children.Add(m_CopyControl); Grid.SetRow(m_CopyControl, 1); RanetToolBarButton m_ImportLayout = new RanetToolBarButton(); m_ImportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileImport16); m_ImportLayout.Click += new RoutedEventHandler(m_ImportLayout_Click); ToolTipService.SetToolTip(m_ImportLayout, Localization.ValueCopyControl_ImportSettings_ToolTip); m_ToolBar.AddItem(m_ImportLayout); RanetToolBarButton m_ExportLayout = new RanetToolBarButton(); m_ExportLayout.Content = UiHelper.CreateIcon(UriResources.Images.FileExport16); m_ExportLayout.Click += new RoutedEventHandler(m_ExportLayout_Click); ToolTipService.SetToolTip(m_ExportLayout, Localization.ValueCopyControl_ExportSettings_ToolTip); m_ToolBar.AddItem(m_ExportLayout); m_ToolBar.AddItem(new RanetToolBarSplitter()); RanetToolBarButton m_PreviewButton = new RanetToolBarButton(); m_PreviewButton.Content = UiHelper.CreateIcon(UriResources.Images.Run16); m_PreviewButton.Click += new RoutedEventHandler(m_PreviewButton_Click); ToolTipService.SetToolTip(m_PreviewButton, Localization.ValueCopyControl_RunCopyForm_Tooltip); m_ToolBar.AddItem(m_PreviewButton); m_OlapDataLoader = GetOlapDataLoader(); m_StorageManager = GetStorageManager(); m_StorageManager.InvokeCompleted += new EventHandler <DataLoaderEventArgs>(StorageManager_ActionCompleted); m_OlapDataLoader.DataLoaded += new EventHandler <DataLoaderEventArgs>(OlapDataLoader_DataLoaded); grdIsWaiting = new Grid() { Background = new SolidColorBrush(Color.FromArgb(125, 0xFF, 0xFF, 0xFF)) }; grdIsWaiting.Visibility = Visibility.Collapsed; BusyControl m_Waiting = new BusyControl(); m_Waiting.Text = Localization.Loading; grdIsWaiting.Children.Add(m_Waiting); LayoutRoot.Children.Add(grdIsWaiting); Grid.SetColumnSpan(grdIsWaiting, LayoutRoot.ColumnDefinitions.Count > 0 ? LayoutRoot.ColumnDefinitions.Count : 1); Grid.SetRowSpan(grdIsWaiting, LayoutRoot.RowDefinitions.Count > 0 ? LayoutRoot.RowDefinitions.Count : 1); this.Content = LayoutRoot; }
public DeleteButton() { this.Content = UiHelper.CreateIcon(UriResources.Images.RemoveHot16); this.Height = 18; this.Width = 18; }
public DataSourceInfoControl() { Grid LayoutRoot = new Grid(); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); LayoutRoot.RowDefinitions.Add(new RowDefinition()); LayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); // Строка соединения TextBlock connectionString_Label = new TextBlock() { Text = Localization.Connection + ":" }; LayoutRoot.Children.Add(connectionString_Label); connectionString = new RichTextBox() { IsReadOnly = true }; connectionString.Height = 22; connectionString.Margin = new Thickness(0, 5, 0, 0); LayoutRoot.Children.Add(connectionString); Grid.SetRow(connectionString, 1); //connectionString.Background = new SolidColorBrush(Colors.Transparent); // Запрос queryInfoTabControl = new RanetTabControl(); queryInfoTabControl.Margin = new Thickness(0, 5, 0, 0); LayoutRoot.Children.Add(queryInfoTabControl); Grid.SetRow(queryInfoTabControl, 2); // Закладка "MDX Query" TabItem queryTab = new TabItem(); queryTab.Header = Localization.MDXQuery; queryTab.Style = queryInfoTabControl.Resources["TabControlOutputItem"] as Style; queryInfoTabControl.TabCtrl.Items.Add(queryTab); Grid queryTabLayoutRoot = new Grid() { Margin = new Thickness(0, 0, 0, 0) }; queryTabLayoutRoot.RowDefinitions.Add(new RowDefinition()); queryTabLayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); mdxQuery = new RichTextBox() { AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, IsReadOnly = true }; mdxQuery.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; mdxQuery.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; queryTabLayoutRoot.Children.Add(mdxQuery); Grid.SetRow(mdxQuery, 0); parseMdx = new CheckBox() { Margin = new Thickness(0, 5, 0, 0) }; parseMdx.Content = Localization.DataSourceInfo_ShowParsedQuery; queryTabLayoutRoot.Children.Add(parseMdx); Grid.SetRow(parseMdx, 1); parseMdx.Checked += new RoutedEventHandler(parseMdx_CheckedChanged); parseMdx.Unchecked += new RoutedEventHandler(parseMdx_CheckedChanged); queryTab.Content = queryTabLayoutRoot; // Закладка "Moved Axes" TabItem movedAxesTab = new TabItem(); movedAxesTab.Header = Localization.DataSourceInfo_MovedAxes; movedAxesTab.Style = queryInfoTabControl.Resources["TabControlOutputItem"] as Style; queryInfoTabControl.TabCtrl.Items.Add(movedAxesTab); Grid movedAxesTabLayoutRoot = new Grid() { Margin = new Thickness(0, 0, 0, 0) }; movedAxesTabLayoutRoot.RowDefinitions.Add(new RowDefinition()); movedAxesTabLayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); movedAxes_MdxQuery = new RichTextBox() { AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, IsReadOnly = true }; movedAxes_MdxQuery.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; movedAxes_MdxQuery.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; movedAxesTabLayoutRoot.Children.Add(movedAxes_MdxQuery); Grid.SetRow(movedAxes_MdxQuery, 0); parseMovedAxesMdx = new CheckBox() { Margin = new Thickness(0, 5, 0, 0) }; parseMovedAxesMdx.Content = Localization.DataSourceInfo_ShowParsedQuery; movedAxesTabLayoutRoot.Children.Add(parseMovedAxesMdx); Grid.SetRow(parseMovedAxesMdx, 1); parseMovedAxesMdx.Checked += new RoutedEventHandler(parseMovedAxesMdx_CheckedChanged); parseMovedAxesMdx.Unchecked += new RoutedEventHandler(parseMovedAxesMdx_CheckedChanged); movedAxesTab.Content = movedAxesTabLayoutRoot; // Закладка "Update Script" scriptTab = new TabItem(); scriptTab.Header = Localization.UpdateScript; scriptTab.Style = queryInfoTabControl.Resources["TabControlOutputItem"] as Style; queryInfoTabControl.TabCtrl.Items.Add(scriptTab); Grid scriptTabLayoutRoot = new Grid() { Margin = new Thickness(0, 0, 0, 0) }; scriptTabLayoutRoot.RowDefinitions.Add(new RowDefinition()); scriptTabLayoutRoot.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); updateScript = new RichTextBox() { AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, IsReadOnly = true }; updateScript.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; updateScript.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; scriptTabLayoutRoot.Children.Add(updateScript); Grid.SetRow(updateScript, 0); parseUpdateScript = new CheckBox() { Margin = new Thickness(0, 5, 0, 0) }; parseUpdateScript.Content = Localization.DataSourceInfo_ShowParsedScript; scriptTabLayoutRoot.Children.Add(parseUpdateScript); Grid.SetRow(parseUpdateScript, 1); parseUpdateScript.Checked += new RoutedEventHandler(parseUpdateScript_CheckedChanged); parseUpdateScript.Unchecked += new RoutedEventHandler(parseUpdateScript_CheckedChanged); scriptTab.Content = scriptTabLayoutRoot; this.Content = LayoutRoot; TabToolBar toolBar = queryInfoTabControl.ToolBar; if (toolBar != null) { RanetToolBarButton copyBtn = new RanetToolBarButton(); ToolTipService.SetToolTip(copyBtn, Localization.CopyToClipboard_ToolTip); copyBtn.Content = UiHelper.CreateIcon(UriResources.Images.Copy16); toolBar.Stack.Children.Add(copyBtn); copyBtn.Click += new RoutedEventHandler(CopyButton_Click); } }