public static ToolBarButton NewToolbarButton(EntityOperationContext eoc)
        {
            var man = OperationClient.Manager;

            ToolBarButton button = new ToolBarButton
            {
                Content = man.GetText(eoc.OperationInfo.OperationSymbol, eoc.OperationSettings),
                Image = man.GetImage(eoc.OperationInfo.OperationSymbol, eoc.OperationSettings),
                Tag = eoc.OperationInfo,
                Background = man.GetBackground(eoc.OperationInfo, eoc.OperationSettings)
            };

            if (eoc.OperationSettings != null && eoc.OperationSettings.Order != 0)
                Common.SetOrder(button, eoc.OperationSettings.Order);

            AutomationProperties.SetName(button, eoc.OperationInfo.OperationSymbol.Key);

            eoc.SenderButton = button;

            if (eoc.CanExecute != null)
            {
                button.ToolTip = eoc.CanExecute;
                button.IsEnabled = false;
                ToolTipService.SetShowOnDisabled(button, true);
                AutomationProperties.SetHelpText(button, eoc.CanExecute);
            }
            else
            {
                button.Click += (_, __) => OperationExecute(eoc);
            }
            return button;
        }
Example #2
0
    public MForm4()
    {
        Size = new Size(250, 200);
        Text = "Simple toolbar";

        toolBar = new ToolBar();
        toolBar.Parent = this;
        toolBarIcons = new ImageList();
        save = new ToolBarButton();
        exit = new ToolBarButton();

        save.ImageIndex = 0;
        save.Tag = "Save";
        exit.ImageIndex = 1;
        exit.Tag = "Exit";

        toolBar.ImageList = toolBarIcons;
        toolBar.ShowToolTips = true;
        toolBar.Buttons.AddRange(new ToolBarButton[] {save, exit});
        toolBar.ButtonClick += new ToolBarButtonClickEventHandler(OnClicked);

        toolBarIcons.Images.Add(Image.FromFile("new.png"));
        toolBarIcons.Images.Add(Image.FromFile("exit.png"));

        CenterToScreen();
    }
Example #3
0
	public MainForm ()
	{
		// 
		// _toolBar
		// 
		_toolBar = new ToolBar ();
		_toolBar.Dock = DockStyle.Top;
		_toolBar.ButtonClick += new  ToolBarButtonClickEventHandler (ToolBar_ButtonClick);
		Controls.Add (_toolBar);
		// 
		// _showFormButton
		// 
		_showFormButton = new ToolBarButton ();
		_showFormButton.Text = "Show Form";
		_toolBar.Buttons.Add (_showFormButton);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 300);
		IsMdiContainer = true;
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #328019";
		Load += new EventHandler (MainForm_Load);
	}
Example #4
0
        public Toolbar(string title, string url)
        {
            _currentButton = new ToolBarButton(title, url);

            if(!_buttons.Contains(_currentButton))
                _buttons.Add(_currentButton);
        }
Example #5
0
 private static void WriteButton(HtmlTextWriter writer, ToolBarButton button)
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Class, "g_ToolbarButton");
     if(!string.IsNullOrEmpty(button.Id))
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Id, button.Id);
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Span);
     writer.AddAttribute(HtmlTextWriterAttribute.Href, button.Url);
     if(!string.IsNullOrEmpty(button.Onclick))
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Onclick, button.Onclick);
     }
     writer.RenderBeginTag(HtmlTextWriterTag.A);
     if(!string.IsNullOrEmpty(button.Img))
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Src, button.Img);
         writer.AddAttribute(HtmlTextWriterAttribute.Alt, button.Alt);
         writer.RenderBeginTag(HtmlTextWriterTag.Img);
         writer.RenderEndTag();
     }
     writer.Write(button.Title);
     writer.RenderEndTag();
     writer.RenderEndTag();
 }
Example #6
0
	public MainForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Bottom;
		_tabControl.Height = 200;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Location = new Point (8, 8);
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Click the arrow on the dropdown button.{0}{0}" +
			"2. Click the arrow on the dropdown button.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. On step 1, a menu is dropped down.{0}{0}" +
			"2. On step 2, the menu is closed.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// _toolBar
		// 
		_toolBar = new ToolBar ();
		_toolBar.AutoSize = true;
		_toolBar.Appearance = ToolBarAppearance.Flat;
		Controls.Add (_toolBar);
		// 
		// _dropDownButton
		// 
		_dropDownButton = new ToolBarButton ();
		_dropDownButton.DropDownMenu = new ContextMenu (new MenuItem [] {
			new MenuItem ("Send") });
		_dropDownButton.Style = ToolBarButtonStyle.DropDownButton;
		_dropDownButton.ToolTipText = "Drop Down";
		_dropDownButton.Text = "&Drop Down";
		_toolBar.Buttons.Add (_dropDownButton);
		// 
		// MainForm
		// 
		StartPosition = FormStartPosition.CenterScreen;
		ClientSize = new Size (300, 260);
		Text = "bug #81675";
	}
Example #7
0
	public MainForm ()
	{
		// 
		// _toolBar
		// 
		_toolBar = new ToolBar ();
		_toolBar.DropDownArrows = true;
		_toolBar.Dock = DockStyle.Top;
		_toolBar.ShowToolTips = true;
		_toolBar.TabIndex = 1;
		Controls.Add (_toolBar);
		// 
		// _toolBarButton1
		// 
		_toolBarButton1 = new ToolBarButton ();
		_toolBarButton1.Text = "Open";
		_toolBar.Buttons.Add (_toolBarButton1);
		// 
		// _toolBarButton2
		// 
		_toolBarButton2 = new ToolBarButton ();
		_toolBarButton2.Text = "New Document";
		_toolBar.Buttons.Add (_toolBarButton2);
		// 
		// _toolBarButton3
		// 
		_toolBarButton3 = new ToolBarButton ();
		_toolBar.Buttons.Add (_toolBarButton3);
		// 
		// _toolBarButton4
		// 
		_toolBarButton4 = new ToolBarButton ();
		_toolBarButton4.Text = "Quit";
		_toolBar.Buttons.Add (_toolBarButton4);
		// 
		// _textCheckBox
		// 
		_textCheckBox = new CheckBox ();
		_textCheckBox.Checked = true;
		_textCheckBox.Location = new Point (8, 45);
		_textCheckBox.Text = "Text";
		_textCheckBox.CheckedChanged += new EventHandler (TextCheckBox_CheckedChanged);
		Controls.Add (_textCheckBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (400, 105);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81524";
		Load += new EventHandler (MainForm_Load);
	}
Example #8
0
	public TreeViewTest ()
	{
		tool_bar = new ToolBar ();
		show_plus_minus = new ToolBarButton ("Show Plus Minus");
		show_root_lines = new ToolBarButton ("Show Root Lines");
		show_lines = new ToolBarButton ("Show Lines");
		show_checkboxes = new ToolBarButton ("Show Check Boxes");
		sort = new ToolBarButton ("Sort Tree");
		expand_odd = new ToolBarButton ("Expand Every Other Node");
		
		tool_bar.Buttons.Add (show_plus_minus);
		tool_bar.Buttons.Add (show_root_lines);
		tool_bar.Buttons.Add (show_lines);
		tool_bar.Buttons.Add (show_checkboxes);
		tool_bar.Buttons.Add (sort);
		tool_bar.Buttons.Add (expand_odd);
		
		tool_bar.ButtonClick += new ToolBarButtonClickEventHandler (ToolBarButtonClick);


		tree_view = new TreeView ();
		tree_view.Anchor = AnchorStyles.Top | AnchorStyles.Left;
		tree_view.Width = Width;
//		tree_view.CheckBoxes = true;
		tree_view.LabelEdit = true;
		
		tree_view.Top = tool_bar.Bottom + 25;
		tree_view.Height = Height - tool_bar.Height - 50;
		tree_view.Width = Width - 25;
		tree_view.Dock = DockStyle.Fill;
		tree_view.BeforeSelect += new TreeViewCancelEventHandler (BeforeSelectHandler);
		tree_view.BeforeCheck += new TreeViewCancelEventHandler (BeforeCheckHandler);
		
		tree_view.ImageList = new ImageList ();
		
		SetupImageList (tree_view.ImageList);

		FillMyTreeView ();


		Controls.Add (tree_view);
		Controls.Add (tool_bar);

		tree_view.Nodes [0].Expand ();
/*
		timer = new Timer ();
		timer.Interval = 250;
		timer.Tick += new EventHandler (AddNodeHandler);
		timer.Enabled = true;
*/
	}
Example #9
0
    public MForm()
    {
        Text = "FolderBrowserDialog";

        toolbar = new ToolBar();
        open = new ToolBarButton();

        statusbar = new StatusBar();
        statusbar.Parent = this;

        toolbar.Buttons.Add(open);
        toolbar.ButtonClick += new ToolBarButtonClickEventHandler(OnClicked);

        Controls.Add(toolbar);

        CenterToScreen();
    }
    public MForm2()
    {
        Text = "ColorDialog";

        color = Color.Blue;

        toolbar = new ToolBar();
        open = new ToolBarButton();

        toolbar.Buttons.Add(open);
        toolbar.ButtonClick += new ToolBarButtonClickEventHandler(OnClicked);

        LocateRect();

        SetStyle (ControlStyles.ResizeRedraw, true);
        Controls.Add(toolbar);
        Paint += new PaintEventHandler(OnPaint);

        CenterToScreen();
    }
    public MForm4()
    {
        Text = "OpenFileDialog";

        toolbar = new ToolBar();
        open = new ToolBarButton();

        textbox = new TextBox();
        textbox.Multiline = true;
        textbox.ScrollBars = ScrollBars.Both;
        textbox.WordWrap = false;
        textbox.Parent = this;
        textbox.Dock = DockStyle.Fill;

        toolbar.Buttons.Add(open);
        toolbar.ButtonClick += new ToolBarButtonClickEventHandler(OnClicked);

        Controls.Add(toolbar);
        Controls.Add(textbox);

         	CenterToScreen();
    }
    public MForm3()
    {
        Text = "FontDialog";

        text = new Label();
        text.Parent = this;
        text.Text = "Winforms tutorial";

        LocateText();

        toolbar = new ToolBar();
        toolbar.Parent = this;
        open = new ToolBarButton();

        toolbar.Buttons.Add(open);
        toolbar.ButtonClick += new ToolBarButtonClickEventHandler(OnClicked);

        text.AutoSize = true;
        Resize += new EventHandler(OnResize);

        CenterToScreen();
    }
    public OldToolBar()
    {
        this.Text = "ToolBar 예제. 닷넷 1.x 형태";
        ImageList lstlist = new ImageList();
        lstlist.Images.Add(new Bitmap(GetType(), "OldToolBar.대한민국.bmp"));
        lstlist.Images.Add(new Bitmap(GetType(), "OldToolBar.캐나다.bmp"));
        lstlist.Images.Add(new Bitmap(GetType(), "OldToolBar.프랑스.bmp"));

        ToolBar tool = new ToolBar();
        tool.Parent = this;
        tool.ImageList = lstlist;
        tool.ShowToolTips = true;
        tool.BorderStyle = BorderStyle.Fixed3D;

        ToolBarButton[] button = new ToolBarButton[3];
        string[] str = { "대한민국", "캐나다", "프랑스" };
        for (int i = 0; i < 3; i++)
        {
            button[i] = new ToolBarButton();
            button[i].ImageIndex = i;
            button[i].ToolTipText = str[i];
            tool.Buttons.Add(button[i]);
        }
    }
    public CslaFormAction GetActionType(ToolBarButton ctl)
    {
      if (_sources.ContainsKey(ctl))
        return _sources[ctl].ActionType;

      return CslaActionExtenderProperties.ActionTypeDefault;
    }
 private void ChangeEnabled(ToolBarButton ctl, bool newEnabled)
 {
   // only do this if it's changed to avoid flicker
   if (ctl.Enabled != newEnabled)
     ctl.Enabled = newEnabled;
 }
Example #16
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GridForm));
     this.imlToolbar               = new System.Windows.Forms.ImageList(this.components);
     this.mnuGrid                  = new System.Windows.Forms.ContextMenu();
     this.mnuGrid_Create           = new System.Windows.Forms.MenuItem();
     this.mnuGrid_Update           = new System.Windows.Forms.MenuItem();
     this.mnuGrid_Delete           = new System.Windows.Forms.MenuItem();
     this.mnuGrid_Retrieve         = new System.Windows.Forms.MenuItem();
     this.mnuGrid_Sep1             = new System.Windows.Forms.MenuItem();
     this.mnuGrid_ResetLayout      = new System.Windows.Forms.MenuItem();
     this.imlToolbox               = new System.Windows.Forms.ImageList(this.components);
     this.pnlGrid                  = new System.Windows.Forms.Panel();
     this.grdData                  = new Janus.Windows.GridEX.GridEX();
     this.tbrGrid                  = new System.Windows.Forms.ToolBar();
     this.tbtCreate                = new System.Windows.Forms.ToolBarButton();
     this.tbtUpdate                = new System.Windows.Forms.ToolBarButton();
     this.tbtDelete                = new System.Windows.Forms.ToolBarButton();
     this.tbtRetrieve              = new System.Windows.Forms.ToolBarButton();
     this.tbtSep1                  = new System.Windows.Forms.ToolBarButton();
     this.tbtReload                = new System.Windows.Forms.ToolBarButton();
     this.tbtSep2                  = new System.Windows.Forms.ToolBarButton();
     this.tbtMoveFirst             = new System.Windows.Forms.ToolBarButton();
     this.tbtMoveBack              = new System.Windows.Forms.ToolBarButton();
     this.tbtMoveNext              = new System.Windows.Forms.ToolBarButton();
     this.tbtMoveLast              = new System.Windows.Forms.ToolBarButton();
     this.tbtSep3                  = new System.Windows.Forms.ToolBarButton();
     this.tbtExport                = new System.Windows.Forms.ToolBarButton();
     this.tbtPrint                 = new System.Windows.Forms.ToolBarButton();
     this.pnlToolbox               = new System.Windows.Forms.Panel();
     this.tbcToolbox               = new System.Windows.Forms.TabControl();
     this.tbpFilter                = new System.Windows.Forms.TabPage();
     this.gridFilterToolbox        = new FrameWork.CRUDModel.Windows.UI.Grid.GridFilterToolbox();
     this.tbpFreezeColumns         = new System.Windows.Forms.TabPage();
     this.gridFreezeColumnsToolbox = new FrameWork.CRUDModel.Windows.UI.Grid.GridFreezeColumnsToolbox();
     this.tbpAggregate             = new System.Windows.Forms.TabPage();
     this.gridAggregateToolbox     = new FrameWork.CRUDModel.Windows.UI.Grid.GridAggregateToolbox();
     this.tbpOrder                 = new System.Windows.Forms.TabPage();
     this.gridOrderToolbox         = new FrameWork.CRUDModel.Windows.UI.Grid.GridOrderToolbox();
     this.tbpFind                  = new System.Windows.Forms.TabPage();
     this.gridFindToolbox          = new FrameWork.CRUDModel.Windows.UI.Grid.GridFindToolbox();
     this.tbpColumns               = new System.Windows.Forms.TabPage();
     this.gridColumnsToolbox       = new FrameWork.CRUDModel.Windows.UI.Grid.GridColumnsToolbox();
     this.pnlGrid.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.grdData)).BeginInit();
     this.pnlToolbox.SuspendLayout();
     this.tbcToolbox.SuspendLayout();
     this.tbpFilter.SuspendLayout();
     this.tbpFreezeColumns.SuspendLayout();
     this.tbpAggregate.SuspendLayout();
     this.tbpOrder.SuspendLayout();
     this.tbpFind.SuspendLayout();
     this.tbpColumns.SuspendLayout();
     this.SuspendLayout();
     //
     // imlToolbar
     //
     this.imlToolbar.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlToolbar.ImageStream")));
     this.imlToolbar.TransparentColor = System.Drawing.Color.Empty;
     this.imlToolbar.Images.SetKeyName(0, "");
     this.imlToolbar.Images.SetKeyName(1, "");
     this.imlToolbar.Images.SetKeyName(2, "");
     this.imlToolbar.Images.SetKeyName(3, "");
     this.imlToolbar.Images.SetKeyName(4, "");
     this.imlToolbar.Images.SetKeyName(5, "");
     this.imlToolbar.Images.SetKeyName(6, "");
     this.imlToolbar.Images.SetKeyName(7, "");
     this.imlToolbar.Images.SetKeyName(8, "");
     this.imlToolbar.Images.SetKeyName(9, "");
     this.imlToolbar.Images.SetKeyName(10, "");
     //
     // mnuGrid
     //
     this.mnuGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.mnuGrid_Create,
         this.mnuGrid_Update,
         this.mnuGrid_Delete,
         this.mnuGrid_Retrieve,
         this.mnuGrid_Sep1,
         this.mnuGrid_ResetLayout
     });
     //
     // mnuGrid_Create
     //
     this.mnuGrid_Create.Index  = 0;
     this.mnuGrid_Create.Text   = "Agregar";
     this.mnuGrid_Create.Click += new System.EventHandler(this.mnuGrid_Create_Click);
     //
     // mnuGrid_Update
     //
     this.mnuGrid_Update.Index  = 1;
     this.mnuGrid_Update.Text   = "Modificar";
     this.mnuGrid_Update.Click += new System.EventHandler(this.mnuGrid_Update_Click);
     //
     // mnuGrid_Delete
     //
     this.mnuGrid_Delete.Index  = 2;
     this.mnuGrid_Delete.Text   = "Eliminar";
     this.mnuGrid_Delete.Click += new System.EventHandler(this.mnuGrid_Delete_Click);
     //
     // mnuGrid_Retrieve
     //
     this.mnuGrid_Retrieve.Index  = 3;
     this.mnuGrid_Retrieve.Text   = "Consultar";
     this.mnuGrid_Retrieve.Click += new System.EventHandler(this.mnuGrid_Retrieve_Click);
     //
     // mnuGrid_Sep1
     //
     this.mnuGrid_Sep1.Index = 4;
     this.mnuGrid_Sep1.Text  = "-";
     //
     // mnuGrid_ResetLayout
     //
     this.mnuGrid_ResetLayout.Index  = 5;
     this.mnuGrid_ResetLayout.Text   = "Restablecer Grilla";
     this.mnuGrid_ResetLayout.Click += new System.EventHandler(this.mnuGrid_ResetLayout_Click);
     //
     // imlToolbox
     //
     this.imlToolbox.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlToolbox.ImageStream")));
     this.imlToolbox.TransparentColor = System.Drawing.Color.Transparent;
     this.imlToolbox.Images.SetKeyName(0, "");
     this.imlToolbox.Images.SetKeyName(1, "");
     this.imlToolbox.Images.SetKeyName(2, "");
     this.imlToolbox.Images.SetKeyName(3, "");
     this.imlToolbox.Images.SetKeyName(4, "");
     //
     // pnlGrid
     //
     this.pnlGrid.Controls.Add(this.grdData);
     this.pnlGrid.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.pnlGrid.Location = new System.Drawing.Point(0, 48);
     this.pnlGrid.Name     = "pnlGrid";
     this.pnlGrid.Size     = new System.Drawing.Size(532, 289);
     this.pnlGrid.TabIndex = 11;
     //
     // grdData
     //
     this.grdData.AllowEdit         = Janus.Windows.GridEX.InheritableBoolean.False;
     this.grdData.AlternatingColors = true;
     this.grdData.AlternatingRowFormatStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
     this.grdData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                  | System.Windows.Forms.AnchorStyles.Left)
                                                                 | System.Windows.Forms.AnchorStyles.Right)));
     this.grdData.ContextMenu           = this.mnuGrid;
     this.grdData.GridLineStyle         = Janus.Windows.GridEX.GridLineStyle.Solid;
     this.grdData.GroupByBoxVisible     = false;
     this.grdData.IncrementalSearchMode = Janus.Windows.GridEX.IncrementalSearchMode.AllCharacters;
     this.grdData.Location = new System.Drawing.Point(8, 8);
     this.grdData.Name     = "grdData";
     this.grdData.RowFormatStyle.BackColor = System.Drawing.SystemColors.Info;
     this.grdData.RowHeaders      = Janus.Windows.GridEX.InheritableBoolean.True;
     this.grdData.Size            = new System.Drawing.Size(516, 273);
     this.grdData.TabIndex        = 4;
     this.grdData.TabKeyBehavior  = Janus.Windows.GridEX.TabKeyBehavior.ControlNavigation;
     this.grdData.VisualStyle     = Janus.Windows.GridEX.VisualStyle.Office2003;
     this.grdData.RowDoubleClick += new Janus.Windows.GridEX.RowActionEventHandler(this.grdData_RowDoubleClick);
     //
     // tbrGrid
     //
     this.tbrGrid.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.tbtCreate,
         this.tbtUpdate,
         this.tbtDelete,
         this.tbtRetrieve,
         this.tbtSep1,
         this.tbtReload,
         this.tbtSep2,
         this.tbtMoveFirst,
         this.tbtMoveBack,
         this.tbtMoveNext,
         this.tbtMoveLast,
         this.tbtSep3,
         this.tbtExport,
         this.tbtPrint
     });
     this.tbrGrid.ButtonSize     = new System.Drawing.Size(24, 24);
     this.tbrGrid.Dock           = System.Windows.Forms.DockStyle.Bottom;
     this.tbrGrid.DropDownArrows = true;
     this.tbrGrid.ImageList      = this.imlToolbar;
     this.tbrGrid.Location       = new System.Drawing.Point(0, 337);
     this.tbrGrid.Name           = "tbrGrid";
     this.tbrGrid.ShowToolTips   = true;
     this.tbrGrid.Size           = new System.Drawing.Size(532, 36);
     this.tbrGrid.TabIndex       = 9;
     this.tbrGrid.ButtonClick   += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbrGrid_ButtonClick);
     //
     // tbtCreate
     //
     this.tbtCreate.ImageIndex  = 0;
     this.tbtCreate.Name        = "tbtCreate";
     this.tbtCreate.ToolTipText = "Agregar";
     //
     // tbtUpdate
     //
     this.tbtUpdate.ImageIndex  = 1;
     this.tbtUpdate.Name        = "tbtUpdate";
     this.tbtUpdate.ToolTipText = "Modificar";
     //
     // tbtDelete
     //
     this.tbtDelete.ImageIndex  = 2;
     this.tbtDelete.Name        = "tbtDelete";
     this.tbtDelete.ToolTipText = "Eliminar";
     //
     // tbtRetrieve
     //
     this.tbtRetrieve.ImageIndex  = 3;
     this.tbtRetrieve.Name        = "tbtRetrieve";
     this.tbtRetrieve.ToolTipText = "Consultar";
     //
     // tbtSep1
     //
     this.tbtSep1.Name  = "tbtSep1";
     this.tbtSep1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // tbtReload
     //
     this.tbtReload.ImageIndex  = 4;
     this.tbtReload.Name        = "tbtReload";
     this.tbtReload.ToolTipText = "Recargar Grilla";
     //
     // tbtSep2
     //
     this.tbtSep2.Name  = "tbtSep2";
     this.tbtSep2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // tbtMoveFirst
     //
     this.tbtMoveFirst.ImageIndex  = 5;
     this.tbtMoveFirst.Name        = "tbtMoveFirst";
     this.tbtMoveFirst.ToolTipText = "Primero";
     //
     // tbtMoveBack
     //
     this.tbtMoveBack.ImageIndex  = 6;
     this.tbtMoveBack.Name        = "tbtMoveBack";
     this.tbtMoveBack.ToolTipText = "Anterior";
     //
     // tbtMoveNext
     //
     this.tbtMoveNext.ImageIndex  = 7;
     this.tbtMoveNext.Name        = "tbtMoveNext";
     this.tbtMoveNext.ToolTipText = "Siguiente";
     //
     // tbtMoveLast
     //
     this.tbtMoveLast.ImageIndex  = 8;
     this.tbtMoveLast.Name        = "tbtMoveLast";
     this.tbtMoveLast.ToolTipText = "Último";
     //
     // tbtSep3
     //
     this.tbtSep3.Name  = "tbtSep3";
     this.tbtSep3.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // tbtExport
     //
     this.tbtExport.ImageIndex  = 9;
     this.tbtExport.Name        = "tbtExport";
     this.tbtExport.ToolTipText = "Exportar a Excel";
     //
     // tbtPrint
     //
     this.tbtPrint.ImageIndex  = 10;
     this.tbtPrint.Name        = "tbtPrint";
     this.tbtPrint.ToolTipText = "Imprimir";
     //
     // pnlToolbox
     //
     this.pnlToolbox.Controls.Add(this.tbcToolbox);
     this.pnlToolbox.Dock     = System.Windows.Forms.DockStyle.Top;
     this.pnlToolbox.Location = new System.Drawing.Point(0, 0);
     this.pnlToolbox.Name     = "pnlToolbox";
     this.pnlToolbox.Padding  = new System.Windows.Forms.Padding(8);
     this.pnlToolbox.Size     = new System.Drawing.Size(532, 48);
     this.pnlToolbox.TabIndex = 10;
     this.pnlToolbox.Leave   += new System.EventHandler(this.pnlToolbox_Leave);
     //
     // tbcToolbox
     //
     this.tbcToolbox.Alignment = System.Windows.Forms.TabAlignment.Bottom;
     this.tbcToolbox.Controls.Add(this.tbpFilter);
     this.tbcToolbox.Controls.Add(this.tbpFreezeColumns);
     this.tbcToolbox.Controls.Add(this.tbpAggregate);
     this.tbcToolbox.Controls.Add(this.tbpOrder);
     this.tbcToolbox.Controls.Add(this.tbpFind);
     this.tbcToolbox.Controls.Add(this.tbpColumns);
     this.tbcToolbox.Dock                  = System.Windows.Forms.DockStyle.Fill;
     this.tbcToolbox.ImageList             = this.imlToolbox;
     this.tbcToolbox.ItemSize              = new System.Drawing.Size(59, 22);
     this.tbcToolbox.Location              = new System.Drawing.Point(8, 8);
     this.tbcToolbox.Multiline             = true;
     this.tbcToolbox.Name                  = "tbcToolbox";
     this.tbcToolbox.SelectedIndex         = 0;
     this.tbcToolbox.Size                  = new System.Drawing.Size(516, 32);
     this.tbcToolbox.TabIndex              = 0;
     this.tbcToolbox.SelectedIndexChanged += new System.EventHandler(this.tbcToolbox_SelectedIndexChanged);
     //
     // tbpFilter
     //
     this.tbpFilter.AutoScroll = true;
     this.tbpFilter.Controls.Add(this.gridFilterToolbox);
     this.tbpFilter.ImageIndex = 0;
     this.tbpFilter.Location   = new System.Drawing.Point(4, 4);
     this.tbpFilter.Name       = "tbpFilter";
     this.tbpFilter.Size       = new System.Drawing.Size(508, 2);
     this.tbpFilter.TabIndex   = 0;
     this.tbpFilter.Text       = "Filtrar";
     //
     // gridFilterToolbox
     //
     this.gridFilterToolbox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gridFilterToolbox.Location = new System.Drawing.Point(0, 0);
     this.gridFilterToolbox.Name     = "gridFilterToolbox";
     this.gridFilterToolbox.Size     = new System.Drawing.Size(508, 2);
     this.gridFilterToolbox.TabIndex = 0;
     //
     // tbpFreezeColumns
     //
     this.tbpFreezeColumns.Controls.Add(this.gridFreezeColumnsToolbox);
     this.tbpFreezeColumns.ImageIndex = 3;
     this.tbpFreezeColumns.Location   = new System.Drawing.Point(4, 4);
     this.tbpFreezeColumns.Name       = "tbpFreezeColumns";
     this.tbpFreezeColumns.Size       = new System.Drawing.Size(508, 2);
     this.tbpFreezeColumns.TabIndex   = 3;
     this.tbpFreezeColumns.Text       = "Fijar Columnas";
     this.tbpFreezeColumns.Visible    = false;
     //
     // gridFreezeColumnsToolbox
     //
     this.gridFreezeColumnsToolbox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gridFreezeColumnsToolbox.Location = new System.Drawing.Point(0, 0);
     this.gridFreezeColumnsToolbox.Name     = "gridFreezeColumnsToolbox";
     this.gridFreezeColumnsToolbox.Size     = new System.Drawing.Size(508, 2);
     this.gridFreezeColumnsToolbox.TabIndex = 0;
     //
     // tbpAggregate
     //
     this.tbpAggregate.Controls.Add(this.gridAggregateToolbox);
     this.tbpAggregate.ImageIndex = 2;
     this.tbpAggregate.Location   = new System.Drawing.Point(4, 4);
     this.tbpAggregate.Name       = "tbpAggregate";
     this.tbpAggregate.Size       = new System.Drawing.Size(508, 2);
     this.tbpAggregate.TabIndex   = 2;
     this.tbpAggregate.Text       = "Calcular";
     this.tbpAggregate.Visible    = false;
     //
     // gridAggregateToolbox
     //
     this.gridAggregateToolbox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gridAggregateToolbox.Location = new System.Drawing.Point(0, 0);
     this.gridAggregateToolbox.Name     = "gridAggregateToolbox";
     this.gridAggregateToolbox.Size     = new System.Drawing.Size(508, 2);
     this.gridAggregateToolbox.TabIndex = 0;
     //
     // tbpOrder
     //
     this.tbpOrder.AutoScroll = true;
     this.tbpOrder.Controls.Add(this.gridOrderToolbox);
     this.tbpOrder.ImageIndex = 1;
     this.tbpOrder.Location   = new System.Drawing.Point(4, 4);
     this.tbpOrder.Name       = "tbpOrder";
     this.tbpOrder.Size       = new System.Drawing.Size(508, 2);
     this.tbpOrder.TabIndex   = 1;
     this.tbpOrder.Text       = "Ordenar";
     this.tbpOrder.Visible    = false;
     //
     // gridOrderToolbox
     //
     this.gridOrderToolbox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gridOrderToolbox.Location = new System.Drawing.Point(0, 0);
     this.gridOrderToolbox.Name     = "gridOrderToolbox";
     this.gridOrderToolbox.Size     = new System.Drawing.Size(508, 2);
     this.gridOrderToolbox.TabIndex = 0;
     //
     // tbpFind
     //
     this.tbpFind.Controls.Add(this.gridFindToolbox);
     this.tbpFind.ImageIndex = 4;
     this.tbpFind.Location   = new System.Drawing.Point(4, 4);
     this.tbpFind.Name       = "tbpFind";
     this.tbpFind.Size       = new System.Drawing.Size(508, 2);
     this.tbpFind.TabIndex   = 4;
     this.tbpFind.Text       = "Buscar";
     this.tbpFind.Visible    = false;
     //
     // gridFindToolbox
     //
     this.gridFindToolbox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gridFindToolbox.Location = new System.Drawing.Point(0, 0);
     this.gridFindToolbox.Name     = "gridFindToolbox";
     this.gridFindToolbox.Size     = new System.Drawing.Size(508, 2);
     this.gridFindToolbox.TabIndex = 0;
     //
     // tbpColumns
     //
     this.tbpColumns.Controls.Add(this.gridColumnsToolbox);
     this.tbpColumns.Location = new System.Drawing.Point(4, 4);
     this.tbpColumns.Name     = "tbpColumns";
     this.tbpColumns.Size     = new System.Drawing.Size(508, 2);
     this.tbpColumns.TabIndex = 5;
     this.tbpColumns.Text     = "Columnas";
     //
     // gridColumnsToolbox
     //
     this.gridColumnsToolbox.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gridColumnsToolbox.Location = new System.Drawing.Point(0, 0);
     this.gridColumnsToolbox.Name     = "gridColumnsToolbox";
     this.gridColumnsToolbox.Size     = new System.Drawing.Size(508, 2);
     this.gridColumnsToolbox.TabIndex = 0;
     //
     // GridForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(532, 373);
     this.Controls.Add(this.pnlGrid);
     this.Controls.Add(this.tbrGrid);
     this.Controls.Add(this.pnlToolbox);
     this.MinimumSize = new System.Drawing.Size(540, 400);
     this.Name        = "GridForm";
     this.Text        = "GridForm";
     this.Closed     += new System.EventHandler(this.GridForm_Closed);
     this.Load       += new System.EventHandler(this.GridForm_Load);
     this.pnlGrid.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.grdData)).EndInit();
     this.pnlToolbox.ResumeLayout(false);
     this.tbcToolbox.ResumeLayout(false);
     this.tbpFilter.ResumeLayout(false);
     this.tbpFreezeColumns.ResumeLayout(false);
     this.tbpAggregate.ResumeLayout(false);
     this.tbpOrder.ResumeLayout(false);
     this.tbpFind.ResumeLayout(false);
     this.tbpColumns.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #17
0
 private bool Equals(ToolBarButton other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other._title, _title) && Equals(other._url, _url);
 }
    public bool GetDisableWhenUseless(ToolBarButton ctl)
    {
      if (_sources.ContainsKey(ctl))
        return _sources[ctl].DisableWhenUseless;

      return CslaActionExtenderProperties.DisableWhenUselessDefault;
    }
 /// <summary>
 ///  Initializes a new instance of the <see cref='ToolBarButtonClickEventArgs'/>
 ///  class.
 /// </summary>
 public ToolBarButtonClickEventArgs(ToolBarButton button)
 {
     Button = button;
 }
Example #20
0
 /// <summary>
 /// </summary>
 internal void addHandler(ToolBarButton button)
 {
     button.Disposed += DisposedHandler;
 }
Example #21
0
        public override void OnWindowActivated(Window GotFocus, Window LostFocus)
        {
            try
            {
                if (GotFocus == null)
                {
                    return;
                }
                IDesignerHost designer = GotFocus.Object as IDesignerHost;
                if (designer == null)
                {
                    return;
                }
                ProjectItem pi = GotFocus.ProjectItem;
                if (!(pi.Object is Cube))
                {
                    return;
                }
                EditorWindow   win     = (EditorWindow)designer.GetService(typeof(Microsoft.DataWarehouse.ComponentModel.IComponentNavigator));
                VsStyleToolBar toolbar = (VsStyleToolBar)win.SelectedView.GetType().InvokeMember("ToolBar", getflags, null, win.SelectedView, null);

                IntPtr ptr     = win.Handle;
                string sHandle = ptr.ToInt64().ToString();

                if (!windowHandlesFixedPartitionsView.ContainsKey(sHandle))
                {
                    windowHandlesFixedPartitionsView.Add(sHandle, win);
                    win.ActiveViewChanged += new EventHandler(win_ActiveViewChanged);
                }

                //if (win.SelectedView.Caption == "Partitions")
                if (win.SelectedView.MenuItemCommandID.ID == (int)BIDSViewMenuItemCommandID.Partitions)
                {
                    if (!toolbar.Buttons.ContainsKey(this.FullName + "." + SET_ESTIMATED_COUNTS_BUTTON))
                    {
                        ToolBarButton separator = new ToolBarButton();
                        separator.Style = ToolBarButtonStyle.Separator;
                        toolbar.Buttons.Add(separator);

                        toolbar.ImageList.Images.Add(SET_ESTIMATED_COUNTS_ICON_KEY, BIDSHelper.Resources.Common.EstimatedCounts);
                        ToolBarButton oSetAllEstimatedCountsButton = new ToolBarButton();
                        oSetAllEstimatedCountsButton.ToolTipText = "Update All Estimated Counts (BIDS Helper)";
                        oSetAllEstimatedCountsButton.Name        = this.FullName + "." + SET_ESTIMATED_COUNTS_BUTTON;
                        oSetAllEstimatedCountsButton.Tag         = oSetAllEstimatedCountsButton.Name;
                        oSetAllEstimatedCountsButton.ImageIndex  = toolbar.ImageList.Images.IndexOfKey(SET_ESTIMATED_COUNTS_ICON_KEY);
                        oSetAllEstimatedCountsButton.Enabled     = true;
                        oSetAllEstimatedCountsButton.Style       = ToolBarButtonStyle.PushButton;
                        toolbar.Buttons.Add(oSetAllEstimatedCountsButton);

                        toolbar.ImageList.Images.Add(EDIT_AGGREGATIONS_ICON_KEY, BIDSHelper.Resources.Common.EditAggregations);
                        ToolBarButton oEditAggregationsButton = new ToolBarButton();
                        oEditAggregationsButton.ToolTipText = "Edit Aggregations (BIDS Helper)";
                        oEditAggregationsButton.Name        = this.FullName + "." + EDIT_AGGREGATIONS_BUTTON_SUFFIX;
                        oEditAggregationsButton.Tag         = oEditAggregationsButton.Name;
                        oEditAggregationsButton.ImageIndex  = toolbar.ImageList.Images.IndexOfKey(EDIT_AGGREGATIONS_ICON_KEY);
                        oEditAggregationsButton.Enabled     = true;
                        oEditAggregationsButton.Style       = ToolBarButtonStyle.PushButton;
                        toolbar.Buttons.Add(oEditAggregationsButton);

                        if (pi.Name.ToLower().EndsWith(".cube")) //checking the file extension is adequate because this feature is not needed for in online mode (when live connected to the server)
                        {
                            toolbar.ImageList.Images.Add(DEPLOY_AGGREGATION_DESIGNS_ICON_KEY, BIDSHelper.Resources.Common.DeployAggDesignsIcon);
                            ToolBarButton oDeployAggDesignsButton = new ToolBarButton();
                            oDeployAggDesignsButton.ToolTipText = "Deploy Aggregation Designs (BIDS Helper)";
                            oDeployAggDesignsButton.Name        = this.FullName + "." + DEPLOY_AGGREGATION_DESIGNS_BUTTON;
                            oDeployAggDesignsButton.Tag         = oDeployAggDesignsButton.Name;
                            oDeployAggDesignsButton.ImageIndex  = toolbar.ImageList.Images.IndexOfKey(DEPLOY_AGGREGATION_DESIGNS_ICON_KEY);
                            oDeployAggDesignsButton.Enabled     = true;
                            oDeployAggDesignsButton.Style       = ToolBarButtonStyle.PushButton;
                            toolbar.Buttons.Add(oDeployAggDesignsButton);
                        }

                        toolbar.ImageList.Images.Add(STOP_ICON_KEY, BIDSHelper.Resources.Common.Stop);

                        //catch the button clicks of the new buttons we just added
                        toolbar.ButtonClick += new ToolBarButtonClickEventHandler(toolbar_ButtonClick);
                    }
                }
            }
            catch { }
        }
Example #22
0
        void SetAllEstimatedCounts(ToolBarButton button)
        {
            //grab the objects I need before the user has a chance to flip to another active window
            Project       proj     = ApplicationObject.ActiveWindow.Project;
            Window        window   = ApplicationObject.ActiveWindow;
            Cube          cube     = (Cube)this.ApplicationObject.ActiveWindow.ProjectItem.Object;
            IDesignerHost designer = (IDesignerHost)ApplicationObject.ActiveWindow.Object;

            if (MessageBox.Show("Updating all estimated counts with exact counts for all partitions and dimensions\r\ncould take an extremely long time.\r\n\r\nAre you sure you want to continue?", "BIDS Helper - Update All Estimated Counts", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }
            button.ImageIndex = button.Parent.ImageList.Images.IndexOfKey(STOP_ICON_KEY); //change to a stop icon to allow the user to cancel
            Application.DoEvents();

            try
            {
                using (WaitCursor cursor1 = new WaitCursor())
                {
                    ApplicationObject.StatusBar.Animate(true, vsStatusAnimation.vsStatusAnimationGeneral);

                    IComponentChangeService changesvc = (IComponentChangeService)designer.GetService(typeof(IComponentChangeService));
                    changesvc.OnComponentChanging(cube, null);

                    System.Collections.Generic.List <string> errors = new System.Collections.Generic.List <string>();
                    int iProgress = 0;
                    foreach (MeasureGroup mg in cube.MeasureGroups)
                    {
                        ApplicationObject.StatusBar.Progress(true, "Setting Estimated Counts on Measure Group: " + mg.Name, ++iProgress, cube.MeasureGroups.Count + cube.Parent.Dimensions.Count);
                        if (mg.Partitions.Count > 0)
                        {
                            foreach (Partition p in mg.Partitions)
                            {
                                p.EstimatedRows = 0;
                            }
                            foreach (AggregationDesign aggd in mg.AggregationDesigns)
                            {
                                //make sure each measure group dimension and attribute is in each agg design... fixes issue 21220
                                foreach (MeasureGroupDimension mgd in mg.Dimensions)
                                {
                                    if (mgd is RegularMeasureGroupDimension)
                                    {
                                        if (!aggd.Dimensions.Contains(mgd.CubeDimensionID))
                                        {
                                            aggd.Dimensions.Add(mgd.CubeDimensionID);
                                        }
                                        AggregationDesignDimension aggdd = aggd.Dimensions[mgd.CubeDimensionID];
                                        foreach (DimensionAttribute da in mgd.Dimension.Attributes)
                                        {
                                            if (da.AttributeHierarchyEnabled && mgd.CubeDimension.Attributes[da.ID].AttributeHierarchyEnabled && !aggdd.Attributes.Contains(da.ID))
                                            {
                                                aggdd.Attributes.Add(da.ID);
                                            }
                                        }
                                    }
                                }

                                foreach (AggregationDesignDimension aggdim in aggd.Dimensions)
                                {
                                    foreach (AggregationDesignAttribute attr in aggdim.Attributes)
                                    {
                                        try
                                        {
                                            attr.EstimatedCount           = 0;
                                            attr.Attribute.EstimatedCount = 0;
                                        }
                                        catch { }
                                    }
                                }
                                foreach (MeasureGroupDimension mgd in mg.Dimensions)
                                {
                                    if (mgd is RegularMeasureGroupDimension)
                                    {
                                        RegularMeasureGroupDimension dim = (RegularMeasureGroupDimension)mgd;
                                        foreach (Partition p in mg.Partitions)
                                        {
                                            if (p.AggregationDesignID == aggd.ID)
                                            {
                                                try
                                                {
                                                    SetEstimatedCountsOnPartitionThreadInfo info = new SetEstimatedCountsOnPartitionThreadInfo();
                                                    info.instance              = this;
                                                    info.aggDesign             = aggd;
                                                    info.measureGroupDimension = dim;
                                                    info.partition             = p;

                                                    //run as a separate thread so that the main app stays responsive (so you can click the cancel button)
                                                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(StartSetEstimatedCountsOnPartition), info);
                                                    while (!info.done)
                                                    {
                                                        System.Threading.Thread.Sleep(100);
                                                        Application.DoEvents(); //keeps main app responsive
                                                        if (CheckCancelled())
                                                        {
                                                            return;
                                                        }
                                                    }
                                                    errors.AddRange(info.errors);
                                                }
                                                catch (Exception ex)
                                                {
                                                    errors.Add("BIDS Helper error setting estimated counts on partition " + p.Name + " of measure group " + mg.Name + ": " + ex.Message);
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                            //now fill in the count on partitions without agg designs
                            foreach (Partition p in mg.Partitions)
                            {
                                if (p.AggregationDesign == null)
                                {
                                    try
                                    {
                                        SetEstimatedCountsOnPartitionThreadInfo info = new SetEstimatedCountsOnPartitionThreadInfo();
                                        info.instance  = this;
                                        info.partition = p;

                                        //run as a separate thread so that the main app stays responsive (so you can click the cancel button)
                                        System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(StartSetEstimatedCountsOnPartition), info);
                                        while (!info.done)
                                        {
                                            System.Threading.Thread.Sleep(100);
                                            Application.DoEvents(); //keeps main app responsive
                                            if (CheckCancelled())
                                            {
                                                return;
                                            }
                                        }
                                        errors.AddRange(info.errors);
                                    }
                                    catch (Exception ex)
                                    {
                                        errors.Add("BIDS Helper error setting estimated counts on partition " + p.Name + " of measure group " + mg.Name + ": " + ex.Message);
                                    }
                                }
                            }

                            long iMeasureGroupRowsCount = 0;
                            foreach (Partition p in mg.Partitions)
                            {
                                iMeasureGroupRowsCount += p.EstimatedRows;
                            }
                            mg.EstimatedRows = iMeasureGroupRowsCount;
                        }
                    }
                    changesvc.OnComponentChanged(cube, null, null, null); //marks the cube designer as dirty


                    foreach (ProjectItem pi in proj.ProjectItems)
                    {
                        try
                        {
                            if (!(pi.Object is Dimension))
                            {
                                continue;
                            }
                        }
                        catch
                        {
                            continue; //doing the above seems to blow up on certain objects because of threading? this fixes the problem
                        }
                        Dimension dim = (Dimension)pi.Object;
                        ApplicationObject.StatusBar.Progress(true, "Setting Estimated Counts on Dimension: " + dim.Name, ++iProgress, cube.MeasureGroups.Count + cube.Parent.Dimensions.Count);

                        //open but don't show the dimension designer so you can get at the change service so you can mark it dirty
                        bool   bIsOpen = pi.get_IsOpen(EnvDTE.Constants.vsViewKindDesigner);
                        Window win     = null;
                        if (bIsOpen)
                        {
                            foreach (Window w in ApplicationObject.Windows)
                            {
                                if (w.ProjectItem != null && w.ProjectItem.Document != null && w.ProjectItem.Document.FullName == pi.Document.FullName)
                                {
                                    win = w;
                                    break;
                                }
                            }
                        }
                        if (win == null)
                        {
                            win = pi.Open(EnvDTE.Constants.vsViewKindDesigner);
                            if (!bIsOpen)
                            {
                                win.Visible = false;
                            }
                        }
                        designer  = (IDesignerHost)win.Object;
                        changesvc = (IComponentChangeService)designer.GetService(typeof(IComponentChangeService));
                        changesvc.OnComponentChanging(dim, null);

                        if (dim.DataSource != null)
                        {
                            try
                            {
                                DataSourceConnection openedDataSourceConnection = Microsoft.AnalysisServices.Design.DSVUtilities.GetOpenedDataSourceConnection(dim.DataSource);
                                foreach (DimensionAttribute attr in dim.Attributes)
                                {
                                    SetEstimatedCountsOnDimensionThreadInfo info = new SetEstimatedCountsOnDimensionThreadInfo();
                                    info.instance   = this;
                                    info.attribute  = attr;
                                    info.connection = openedDataSourceConnection;

                                    //run as a separate thread so that the main app stays responsive (so you can click the cancel button)
                                    System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(StartSetEstimatedCountsOnDimension), info);
                                    while (!info.done)
                                    {
                                        System.Threading.Thread.Sleep(100);
                                        Application.DoEvents(); //keeps main app responsive
                                        if (CheckCancelled())
                                        {
                                            return;
                                        }
                                    }
                                    errors.AddRange(info.errors);
                                }
                            }
                            catch (Exception ex)
                            {
                                errors.Add("BIDS Helper error setting estimated counts on dimension " + dim.Name + ": " + ex.Message);
                            }
                        }
                        changesvc.OnComponentChanged(dim, null, null, null);
                    }
                    AddErrorsToVSErrorList(window, errors.ToArray());
                }
            }
            finally
            {
                try
                {
                    button.ImageIndex = button.Parent.ImageList.Images.IndexOfKey(SET_ESTIMATED_COUNTS_ICON_KEY);
                    ApplicationObject.StatusBar.Animate(false, vsStatusAnimation.vsStatusAnimationGeneral);
                    ApplicationObject.StatusBar.Progress(false, "", 1, 1);
                }
                catch { }
            }
        }
Example #23
0
    public TextBoxWithToolBar()
    {
        Text = "Text Box with Toolbar";

        // Create TextBox.

        txtbox            = new TextBox();
        txtbox.Parent     = this;
        txtbox.Dock       = DockStyle.Fill;
        txtbox.Multiline  = true;
        txtbox.ScrollBars = ScrollBars.Both;
        txtbox.AcceptsTab = true;

        // Create ImageList.

        Bitmap bm = new Bitmap(GetType(),
                               "TextBoxWithToolBar.StandardButtons.bmp");

        ImageList imglst = new ImageList();

        imglst.Images.AddStrip(bm);
        imglst.TransparentColor = Color.Cyan;

        // Create ToolBar with ButtonClick event handler.

        ToolBar tbar = new ToolBar();

        tbar.Parent       = this;
        tbar.ImageList    = imglst;
        tbar.ShowToolTips = true;
        tbar.ButtonClick +=
            new ToolBarButtonClickEventHandler(ToolBarOnClick);

        // Create the Edit menu.

        Menu = new MainMenu();

        MenuItem mi = new MenuItem("&Edit");

        mi.Popup += new EventHandler(MenuEditOnPopup);
        Menu.MenuItems.Add(mi);

        // Create the Edit Cut menu item.

        miEditCut          = new MenuItem("Cu&t");
        miEditCut.Click   += new EventHandler(MenuEditCutOnClick);
        miEditCut.Shortcut = Shortcut.CtrlX;
        Menu.MenuItems[0].MenuItems.Add(miEditCut);

        // And create the Cut toolbar button.

        tbbCut             = new ToolBarButton();
        tbbCut.ImageIndex  = 4;
        tbbCut.ToolTipText = "Cut";
        tbbCut.Tag         = miEditCut;
        tbar.Buttons.Add(tbbCut);

        // Create the Edit Copy menu item.

        miEditCopy          = new MenuItem("&Copy");
        miEditCopy.Click   += new EventHandler(MenuEditCopyOnClick);
        miEditCopy.Shortcut = Shortcut.CtrlC;
        Menu.MenuItems[0].MenuItems.Add(miEditCopy);

        // And create the Copy toolbar button.

        tbbCopy             = new ToolBarButton();
        tbbCopy.ImageIndex  = 5;
        tbbCopy.ToolTipText = "Copy";
        tbbCopy.Tag         = miEditCopy;
        tbar.Buttons.Add(tbbCopy);

        // Create the Edit Paste menu item.

        miEditPaste          = new MenuItem("&Paste");
        miEditPaste.Click   += new EventHandler(MenuEditPasteOnClick);
        miEditPaste.Shortcut = Shortcut.CtrlV;
        Menu.MenuItems[0].MenuItems.Add(miEditPaste);

        // And create the Paste toolbar button.

        tbbPaste             = new ToolBarButton();
        tbbPaste.ImageIndex  = 6;
        tbbPaste.ToolTipText = "Paste";
        tbbPaste.Tag         = miEditPaste;
        tbar.Buttons.Add(tbbPaste);

        // Set Timer for enabling buttons.

        Timer timer = new Timer();

        timer.Interval = 250;
        timer.Tick    += new EventHandler(TimerOnTick);
        timer.Start();
    }
Example #24
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components     = new System.ComponentModel.Container();
     this.imageListAlpha = new System.Windows.Forms.ImageList(this.components);
     this.toolBar1       = new System.Windows.Forms.ToolBar();
     this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
     this.tabControl1    = new System.Windows.Forms.TabControl();
     this.tabPage1       = new System.Windows.Forms.TabPage();
     this.tabPage2       = new System.Windows.Forms.TabPage();
     this.tabPage3       = new System.Windows.Forms.TabPage();
     this.tabPage4       = new System.Windows.Forms.TabPage();
     this.button1        = new System.Windows.Forms.Button();
     this.tabControl2    = new System.Windows.Forms.TabControl();
     this.tabPage5       = new System.Windows.Forms.TabPage();
     this.listView1      = new System.Windows.Forms.ListView();
     this.columnHeader1  = new System.Windows.Forms.ColumnHeader();
     this.tabPage6       = new System.Windows.Forms.TabPage();
     this.tabPage7       = new System.Windows.Forms.TabPage();
     this.tabPage8       = new System.Windows.Forms.TabPage();
     this.panel1         = new System.Windows.Forms.Panel();
     this.toolBar2       = new System.Windows.Forms.ToolBar();
     this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton7 = new System.Windows.Forms.ToolBarButton();
     this.toolBarButton8 = new System.Windows.Forms.ToolBarButton();
     this.tabControl1.SuspendLayout();
     this.tabControl2.SuspendLayout();
     this.tabPage5.SuspendLayout();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // imageListAlpha
     //
     this.imageListAlpha.ColorDepth       = System.Windows.Forms.ColorDepth.Depth8Bit;
     this.imageListAlpha.ImageSize        = new System.Drawing.Size(16, 16);
     this.imageListAlpha.TransparentColor = System.Drawing.Color.Transparent;
     //
     // toolBar1
     //
     this.toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.toolBarButton1,
         this.toolBarButton2,
         this.toolBarButton3,
         this.toolBarButton4
     });
     this.toolBar1.ButtonSize     = new System.Drawing.Size(32, 32);
     this.toolBar1.Dock           = System.Windows.Forms.DockStyle.Fill;
     this.toolBar1.DropDownArrows = true;
     this.toolBar1.ImageList      = this.imageListAlpha;
     this.toolBar1.Location       = new System.Drawing.Point(0, 0);
     this.toolBar1.Name           = "toolBar1";
     this.toolBar1.ShowToolTips   = true;
     this.toolBar1.Size           = new System.Drawing.Size(600, 29);
     this.toolBar1.TabIndex       = 0;
     //
     // toolBarButton1
     //
     this.toolBarButton1.Name = "toolBarButton1";
     //
     // toolBarButton2
     //
     this.toolBarButton2.Name = "toolBarButton2";
     //
     // toolBarButton3
     //
     this.toolBarButton3.Name = "toolBarButton3";
     //
     // toolBarButton4
     //
     this.toolBarButton4.Name = "toolBarButton4";
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Controls.Add(this.tabPage2);
     this.tabControl1.Controls.Add(this.tabPage3);
     this.tabControl1.Controls.Add(this.tabPage4);
     this.tabControl1.ImageList     = this.imageListAlpha;
     this.tabControl1.Location      = new System.Drawing.Point(14, 113);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(504, 142);
     this.tabControl1.TabIndex      = 2;
     //
     // tabPage1
     //
     this.tabPage1.Location = new System.Drawing.Point(4, 23);
     this.tabPage1.Name     = "tabPage1";
     this.tabPage1.Size     = new System.Drawing.Size(496, 115);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text     = "tabPage1";
     //
     // tabPage2
     //
     this.tabPage2.Location = new System.Drawing.Point(4, 23);
     this.tabPage2.Name     = "tabPage2";
     this.tabPage2.Size     = new System.Drawing.Size(496, 115);
     this.tabPage2.TabIndex = 1;
     this.tabPage2.Text     = "tabPage2";
     //
     // tabPage3
     //
     this.tabPage3.Location = new System.Drawing.Point(4, 23);
     this.tabPage3.Name     = "tabPage3";
     this.tabPage3.Size     = new System.Drawing.Size(496, 115);
     this.tabPage3.TabIndex = 2;
     this.tabPage3.Text     = "tabPage3";
     //
     // tabPage4
     //
     this.tabPage4.Location = new System.Drawing.Point(4, 23);
     this.tabPage4.Name     = "tabPage4";
     this.tabPage4.Size     = new System.Drawing.Size(496, 115);
     this.tabPage4.TabIndex = 3;
     this.tabPage4.Text     = "tabPage4";
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(202, 534);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(136, 26);
     this.button1.TabIndex = 3;
     this.button1.Text     = "Load Images";
     this.button1.Click   += new System.EventHandler(this.button1_Click);
     //
     // tabControl2
     //
     this.tabControl2.Controls.Add(this.tabPage5);
     this.tabControl2.Controls.Add(this.tabPage6);
     this.tabControl2.Controls.Add(this.tabPage7);
     this.tabControl2.Controls.Add(this.tabPage8);
     this.tabControl2.ImageList     = this.imageListAlpha;
     this.tabControl2.Location      = new System.Drawing.Point(18, 278);
     this.tabControl2.Name          = "tabControl2";
     this.tabControl2.SelectedIndex = 0;
     this.tabControl2.Size          = new System.Drawing.Size(504, 245);
     this.tabControl2.TabIndex      = 4;
     //
     // tabPage5
     //
     this.tabPage5.Controls.Add(this.listView1);
     this.tabPage5.Location = new System.Drawing.Point(4, 23);
     this.tabPage5.Name     = "tabPage5";
     this.tabPage5.Size     = new System.Drawing.Size(496, 218);
     this.tabPage5.TabIndex = 0;
     this.tabPage5.Text     = "tabPage1";
     //
     // listView1
     //
     this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this.columnHeader1
     });
     this.listView1.Dock           = System.Windows.Forms.DockStyle.Fill;
     this.listView1.LargeImageList = this.imageListAlpha;
     this.listView1.Location       = new System.Drawing.Point(0, 0);
     this.listView1.Name           = "listView1";
     this.listView1.Size           = new System.Drawing.Size(496, 218);
     this.listView1.TabIndex       = 0;
     this.listView1.UseCompatibleStateImageBehavior = false;
     //
     // columnHeader1
     //
     this.columnHeader1.Width = 156;
     //
     // tabPage6
     //
     this.tabPage6.Location = new System.Drawing.Point(4, 23);
     this.tabPage6.Name     = "tabPage6";
     this.tabPage6.Size     = new System.Drawing.Size(496, 218);
     this.tabPage6.TabIndex = 1;
     this.tabPage6.Text     = "tabPage2";
     this.tabPage6.Visible  = false;
     //
     // tabPage7
     //
     this.tabPage7.Location = new System.Drawing.Point(4, 23);
     this.tabPage7.Name     = "tabPage7";
     this.tabPage7.Size     = new System.Drawing.Size(496, 218);
     this.tabPage7.TabIndex = 2;
     this.tabPage7.Text     = "tabPage3";
     this.tabPage7.Visible  = false;
     //
     // tabPage8
     //
     this.tabPage8.Location = new System.Drawing.Point(4, 23);
     this.tabPage8.Name     = "tabPage8";
     this.tabPage8.Size     = new System.Drawing.Size(496, 218);
     this.tabPage8.TabIndex = 3;
     this.tabPage8.Text     = "tabPage4";
     this.tabPage8.Visible  = false;
     //
     // panel1
     //
     this.panel1.Controls.Add(this.toolBar2);
     this.panel1.Location = new System.Drawing.Point(433, 58);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(63, 259);
     this.panel1.TabIndex = 5;
     //
     // toolBar2
     //
     this.toolBar2.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.toolBarButton5,
         this.toolBarButton6,
         this.toolBarButton7,
         this.toolBarButton8
     });
     this.toolBar2.Dock           = System.Windows.Forms.DockStyle.Fill;
     this.toolBar2.DropDownArrows = true;
     this.toolBar2.ImageList      = this.imageListAlpha;
     this.toolBar2.Location       = new System.Drawing.Point(0, 0);
     this.toolBar2.Name           = "toolBar2";
     this.toolBar2.ShowToolTips   = true;
     this.toolBar2.Size           = new System.Drawing.Size(63, 50);
     this.toolBar2.TabIndex       = 2;
     //
     // toolBarButton5
     //
     this.toolBarButton5.Name = "toolBarButton5";
     //
     // toolBarButton6
     //
     this.toolBarButton6.Name = "toolBarButton6";
     //
     // toolBarButton7
     //
     this.toolBarButton7.Name = "toolBarButton7";
     //
     // toolBarButton8
     //
     this.toolBarButton8.Name = "toolBarButton8";
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
     this.ClientSize        = new System.Drawing.Size(600, 601);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.tabControl2);
     this.Controls.Add(this.button1);
     this.Controls.Add(this.tabControl1);
     this.Controls.Add(this.toolBar1);
     this.Name = "Form1";
     this.Text = "Form1";
     this.tabControl1.ResumeLayout(false);
     this.tabControl2.ResumeLayout(false);
     this.tabPage5.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #25
0
    private FormsHello()
    {
        // Force the entire form to repaint when it is resized.
        SetStyle(ControlStyles.ResizeRedraw, true);

        // Set some initial form properties.
        Size = new Size(400, 270);
        Text = "Forms Hello";

        // Create a button control on the form.
        button          = new Button();
        button.Text     = "Click Me!";
        button.Location = new Point(30, 130);
        Controls.Add(button);

        // Create a progress bar control
        progress          = new ProgressBar();
        progress.Location = new Point(30, 175);
        progress.Anchor   = AnchorStyles.Top |
                            AnchorStyles.Left |
                            AnchorStyles.Right;
        Controls.Add(progress);

        // Create a label and dock it to the bottom.
        Label label = new Label();

        label.Text      = "This is a label, docked to the bottom ...";
        label.BackColor = Color.White;
        label.Dock      = DockStyle.Bottom;
        Controls.Add(label);

        // Hook up interesting events.
        Paint        += new PaintEventHandler(HandlePaint);
        button.Click += new EventHandler(HandleClick);

        // Create a scrollbar control.
        scrollbar      = new HScrollBar();
        scrollbar.Dock = DockStyle.Bottom;
        Controls.Add(scrollbar);
        scrollbar      = new VScrollBar();
        scrollbar.Dock = DockStyle.Right;
        Controls.Add(scrollbar);

        // Create a toolbar control and some toolbar buttons.
        toolbar = new ToolBar();
        toolbar.Buttons.Add("Hello");
        ToolBarButton tbb = new ToolBarButton();

        tbb.Style = ToolBarButtonStyle.Separator;
        toolbar.Buttons.Add(tbb);
        tbb = new ToolBarButton("World!");
        toolbar.Buttons.Add(tbb);
        toolbar.Appearance  = ToolBarAppearance.Flat;
        toolbar.BorderStyle = BorderStyle.FixedSingle;
        Controls.Add(toolbar);

        // Create another toolbar.
        // This reveals some layout bugs, so
        // the Controls.Add is commented out
        // to keep the sample looking good
        toolbar = new ToolBar();
        toolbar.Buttons.Add("This one's");
        tbb       = new ToolBarButton();
        tbb.Style = ToolBarButtonStyle.Separator;
        toolbar.Buttons.Add(tbb);
        tbb       = new ToolBarButton("left docked.");
        tbb.Style = ToolBarButtonStyle.DropDownButton;
        toolbar.Buttons.Add(tbb);
        toolbar.BorderStyle = BorderStyle.Fixed3D;
        toolbar.Dock        = DockStyle.Left;
        //toolbar.DropDownArrows = false;
        //Controls.Add(toolbar);

        checkbox                    = new CheckBox();
        checkbox.Location           = new Point(70, 95);
        checkbox.Text               = "Any Good ?";
        checkbox.Checked            = true;
        checkbox.CheckStateChanged += new EventHandler(HandleCheck);
        Controls.Add(checkbox);
    }
    public PostSaveActionType GetPostSaveAction(ToolBarButton ctl)
    {
      if (_sources.ContainsKey(ctl))
        return _sources[ctl].PostSaveAction;

      return CslaActionExtenderProperties.PostSaveActionDefault;
    }
    public bool GetRebindAfterSave(ToolBarButton ctl)
    {
      if (_sources.ContainsKey(ctl))
        return _sources[ctl].RebindAfterSave;

      return CslaActionExtenderProperties.RebindAfterSaveDefault;
    }
Example #28
0
 /// <summary>
 /// This method is required for Windows Forms designer support.
 /// Do not change the method contents inside the source code editor. The Forms designer might
 /// not be able to load this method if it was changed manually.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WebBrowserViewControl));
     this._buttonForward = new System.Windows.Forms.ToolBarButton();
     this._toolbarImages = new System.Windows.Forms.ImageList(this.components);
     this._buttonBack    = new System.Windows.Forms.ToolBarButton();
     this._toolbar       = new System.Windows.Forms.ToolBar();
     this._webBrowser    = new System.Windows.Forms.WebBrowser();
     this.SuspendLayout();
     //
     // _buttonForward
     //
     this._buttonForward.ImageIndex  = 1;
     this._buttonForward.Name        = "_buttonForward";
     this._buttonForward.ToolTipText = "Forward";
     //
     // _toolbarImages
     //
     this._toolbarImages.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("_toolbarImages.ImageStream")));
     this._toolbarImages.TransparentColor = System.Drawing.Color.White;
     this._toolbarImages.Images.SetKeyName(0, "");
     this._toolbarImages.Images.SetKeyName(1, "");
     //
     // _buttonBack
     //
     this._buttonBack.ImageIndex  = 0;
     this._buttonBack.Name        = "_buttonBack";
     this._buttonBack.ToolTipText = "Back";
     //
     // _toolbar
     //
     this._toolbar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
     this._toolbar.AutoSize   = false;
     this._toolbar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this._buttonBack,
         this._buttonForward
     });
     this._toolbar.ButtonSize     = new System.Drawing.Size(18, 18);
     this._toolbar.Divider        = false;
     this._toolbar.DropDownArrows = true;
     this._toolbar.ImageList      = this._toolbarImages;
     this._toolbar.Location       = new System.Drawing.Point(0, 0);
     this._toolbar.Name           = "_toolbar";
     this._toolbar.ShowToolTips   = true;
     this._toolbar.Size           = new System.Drawing.Size(544, 24);
     this._toolbar.TabIndex       = 0;
     //
     // _webBrowser
     //
     this._webBrowser.Dock     = System.Windows.Forms.DockStyle.Fill;
     this._webBrowser.Location = new System.Drawing.Point(0, 24);
     this._webBrowser.Name     = "_webBrowser";
     this._webBrowser.Size     = new System.Drawing.Size(544, 392);
     this._webBrowser.TabIndex = 1;
     //
     // WebBrowserViewControl
     //
     this.Controls.Add(this._webBrowser);
     this.Controls.Add(this._toolbar);
     this.Name = "WebBrowserViewControl";
     this.Size = new System.Drawing.Size(544, 416);
     this.ResumeLayout(false);
 }
    public string GetCommandName(ToolBarButton ctl)
    {
      if (_sources.ContainsKey(ctl))
        return _sources[ctl].CommandName;

      return CslaActionExtenderProperties.CommandNameDefault;
    }
Example #30
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ReportData));
     this.dlgSaveFile       = new System.Windows.Forms.SaveFileDialog();
     this.imglstButtonImage = new System.Windows.Forms.ImageList(this.components);
     this.tbarReportData    = new System.Windows.Forms.ToolBar();
     this.btnF2             = new System.Windows.Forms.ToolBarButton();
     this.btnF3             = new System.Windows.Forms.ToolBarButton();
     this.btnF4             = new System.Windows.Forms.ToolBarButton();
     this.btnF5             = new System.Windows.Forms.ToolBarButton();
     this.toolBarSeperator1 = new System.Windows.Forms.ToolBarButton();
     this.btnF6             = new System.Windows.Forms.ToolBarButton();
     this.btnF7             = new System.Windows.Forms.ToolBarButton();
     this.btnF8             = new System.Windows.Forms.ToolBarButton();
     this.toolBarSeperator2 = new System.Windows.Forms.ToolBarButton();
     this.btnF9             = new System.Windows.Forms.ToolBarButton();
     this.btnF10            = new System.Windows.Forms.ToolBarButton();
     this.btnF11            = new System.Windows.Forms.ToolBarButton();
     this.gridReportData    = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
     ((System.ComponentModel.ISupportInitialize)(this.gridReportData)).BeginInit();
     this.SuspendLayout();
     //
     // dlgSaveFile
     //
     this.dlgSaveFile.Filter = "Excel file|*.xls";
     //
     // imglstButtonImage
     //
     this.imglstButtonImage.ColorDepth       = System.Windows.Forms.ColorDepth.Depth32Bit;
     this.imglstButtonImage.ImageSize        = new System.Drawing.Size(24, 24);
     this.imglstButtonImage.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imglstButtonImage.ImageStream")));
     this.imglstButtonImage.TransparentColor = System.Drawing.Color.Transparent;
     //
     // tbarReportData
     //
     this.tbarReportData.AutoSize = false;
     this.tbarReportData.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.btnF2,
         this.btnF3,
         this.btnF4,
         this.btnF5,
         this.toolBarSeperator1,
         this.btnF6,
         this.btnF7,
         this.btnF8,
         this.toolBarSeperator2,
         this.btnF9,
         this.btnF10,
         this.btnF11
     });
     this.tbarReportData.ButtonSize     = new System.Drawing.Size(32, 32);
     this.tbarReportData.Dock           = System.Windows.Forms.DockStyle.Fill;
     this.tbarReportData.DropDownArrows = true;
     this.tbarReportData.ImageList      = this.imglstButtonImage;
     this.tbarReportData.ImeMode        = System.Windows.Forms.ImeMode.NoControl;
     this.tbarReportData.Location       = new System.Drawing.Point(0, 0);
     this.tbarReportData.Name           = "tbarReportData";
     this.tbarReportData.ShowToolTips   = true;
     this.tbarReportData.Size           = new System.Drawing.Size(520, 48);
     this.tbarReportData.TabIndex       = 2;
     this.tbarReportData.ButtonClick   += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbarReportData_ButtonClick);
     //
     // btnF2
     //
     this.btnF2.ImageIndex  = 0;
     this.btnF2.ToolTipText = "F2 - Clear all filter";
     //
     // btnF3
     //
     this.btnF3.ImageIndex  = 1;
     this.btnF3.ToolTipText = "F3: Filter with current value";
     //
     // btnF4
     //
     this.btnF4.ImageIndex  = 2;
     this.btnF4.ToolTipText = "F4: Filter with except current value";
     //
     // btnF5
     //
     this.btnF5.ImageIndex  = 3;
     this.btnF5.ToolTipText = "F5: Return previous filter";
     //
     // toolBarSeperator1
     //
     this.toolBarSeperator1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // btnF6
     //
     this.btnF6.ImageIndex  = 4;
     this.btnF6.ToolTipText = "F6: Row filter";
     //
     // btnF7
     //
     this.btnF7.ImageIndex  = 5;
     this.btnF7.ToolTipText = "F7: View single record";
     //
     // btnF8
     //
     this.btnF8.ImageIndex  = 6;
     this.btnF8.ToolTipText = "F8: Sum current column";
     //
     // toolBarSeperator2
     //
     this.toolBarSeperator2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
     //
     // btnF9
     //
     this.btnF9.ImageIndex  = 7;
     this.btnF9.ToolTipText = "F9: Export data to Excel";
     //
     // btnF10
     //
     this.btnF10.ImageIndex  = 8;
     this.btnF10.ToolTipText = "F10: Print data to printer";
     //
     // btnF11
     //
     this.btnF11.ImageIndex  = 9;
     this.btnF11.ToolTipText = "F11: Show drill down report";
     //
     // gridReportData
     //
     this.gridReportData.AllowUpdate = false;
     this.gridReportData.Anchor      = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                              | System.Windows.Forms.AnchorStyles.Left)
                                                                             | System.Windows.Forms.AnchorStyles.Right)));
     this.gridReportData.BorderStyle    = System.Windows.Forms.BorderStyle.FixedSingle;
     this.gridReportData.CaptionHeight  = 17;
     this.gridReportData.CollapseColor  = System.Drawing.Color.Black;
     this.gridReportData.ColumnFooters  = true;
     this.gridReportData.ExpandColor    = System.Drawing.Color.Black;
     this.gridReportData.GroupByCaption = "Drag a column header here to group by that column";
     this.gridReportData.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
     this.gridReportData.Location                    = new System.Drawing.Point(0, 48);
     this.gridReportData.MarqueeStyle                = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
     this.gridReportData.Name                        = "gridReportData";
     this.gridReportData.PreviewInfo.Location        = new System.Drawing.Point(0, 0);
     this.gridReportData.PreviewInfo.Size            = new System.Drawing.Size(0, 0);
     this.gridReportData.PreviewInfo.ZoomFactor      = 75;
     this.gridReportData.PrintInfo.ShowOptionsDialog = false;
     this.gridReportData.RecordSelectorWidth         = 17;
     this.gridReportData.RowDivider.Color            = System.Drawing.Color.DarkGray;
     this.gridReportData.RowDivider.Style            = C1.Win.C1TrueDBGrid.LineStyleEnum.Single;
     this.gridReportData.RowHeight                   = 15;
     this.gridReportData.RowSubDividerColor          = System.Drawing.Color.DarkGray;
     this.gridReportData.Size                        = new System.Drawing.Size(518, 302);
     this.gridReportData.TabIndex                    = 3;
     this.gridReportData.PropBag                     = "<?xml version=\"1.0\"?><Blob><Styles type=\"C1.Win.C1TrueDBGrid.Design.ContextWrappe" +
                                                       "r\"><Data>Group{AlignVert:Center;Border:None,,0, 0, 0, 0;BackColor:ControlDark;}E" +
                                                       "ditor{}Style2{}Style5{}Style4{}Style7{}Style6{}EvenRow{BackColor:Aqua;}Selected{" +
                                                       "ForeColor:HighlightText;BackColor:Highlight;}Style3{}Inactive{ForeColor:Inactive" +
                                                       "CaptionText;BackColor:InactiveCaption;}FilterBar{}Footer{}Caption{AlignHorz:Cent" +
                                                       "er;}Style1{}Normal{}HighlightRow{ForeColor:HighlightText;BackColor:Highlight;}St" +
                                                       "yle12{}OddRow{}RecordSelector{AlignImage:Center;}Style13{}Heading{Wrap:True;Back" +
                                                       "Color:Control;Border:Raised,,1, 1, 1, 1;ForeColor:ControlText;AlignVert:Center;}" +
                                                       "Style8{}Style10{AlignHorz:Near;}Style11{}Style14{}Style15{}Style9{}</Data></Styl" +
                                                       "es><Splits><C1.Win.C1TrueDBGrid.MergeView Name=\"\" CaptionHeight=\"17\" ColumnCapti" +
                                                       "onHeight=\"17\" ColumnFooterHeight=\"17\" MarqueeStyle=\"DottedCellBorder\" RecordSele" +
                                                       "ctorWidth=\"17\" DefRecSelWidth=\"17\" VerticalScrollGroup=\"1\" HorizontalScrollGroup" +
                                                       "=\"1\"><ClientRect>0, 0, 516, 300</ClientRect><BorderSide>0</BorderSide><CaptionSt" +
                                                       "yle parent=\"Style2\" me=\"Style10\" /><EditorStyle parent=\"Editor\" me=\"Style5\" /><E" +
                                                       "venRowStyle parent=\"EvenRow\" me=\"Style8\" /><FilterBarStyle parent=\"FilterBar\" me" +
                                                       "=\"Style13\" /><FooterStyle parent=\"Footer\" me=\"Style3\" /><GroupStyle parent=\"Grou" +
                                                       "p\" me=\"Style12\" /><HeadingStyle parent=\"Heading\" me=\"Style2\" /><HighLightRowStyl" +
                                                       "e parent=\"HighlightRow\" me=\"Style7\" /><InactiveStyle parent=\"Inactive\" me=\"Style" +
                                                       "4\" /><OddRowStyle parent=\"OddRow\" me=\"Style9\" /><RecordSelectorStyle parent=\"Rec" +
                                                       "ordSelector\" me=\"Style11\" /><SelectedStyle parent=\"Selected\" me=\"Style6\" /><Styl" +
                                                       "e parent=\"Normal\" me=\"Style1\" /></C1.Win.C1TrueDBGrid.MergeView></Splits><NamedS" +
                                                       "tyles><Style parent=\"\" me=\"Normal\" /><Style parent=\"Normal\" me=\"Heading\" /><Styl" +
                                                       "e parent=\"Heading\" me=\"Footer\" /><Style parent=\"Heading\" me=\"Caption\" /><Style p" +
                                                       "arent=\"Heading\" me=\"Inactive\" /><Style parent=\"Normal\" me=\"Selected\" /><Style pa" +
                                                       "rent=\"Normal\" me=\"Editor\" /><Style parent=\"Normal\" me=\"HighlightRow\" /><Style pa" +
                                                       "rent=\"Normal\" me=\"EvenRow\" /><Style parent=\"Normal\" me=\"OddRow\" /><Style parent=" +
                                                       "\"Heading\" me=\"RecordSelector\" /><Style parent=\"Normal\" me=\"FilterBar\" /><Style p" +
                                                       "arent=\"Caption\" me=\"Group\" /></NamedStyles><vertSplits>1</vertSplits><horzSplits" +
                                                       ">1</horzSplits><Layout>None</Layout><DefaultRecSelWidth>17</DefaultRecSelWidth><" +
                                                       "ClientArea>0, 0, 516, 300</ClientArea><PrintPageHeaderStyle parent=\"\" me=\"Style1" +
                                                       "4\" /><PrintPageFooterStyle parent=\"\" me=\"Style15\" /></Blob>";
     //
     // ReportData
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(520, 352);
     this.Controls.Add(this.tbarReportData);
     this.Controls.Add(this.gridReportData);
     this.Name  = "ReportData";
     this.Text  = "Report Data";
     this.Load += new System.EventHandler(this.ReportData_Load);
     ((System.ComponentModel.ISupportInitialize)(this.gridReportData)).EndInit();
     this.ResumeLayout(false);
 }
        private void HookupVariablesWindow(Window GotFocus)
        {
            try
            {
                try
                {
                    if (GotFocus == null)
                    {
                        return;
                    }
                    if (GotFocus.ObjectKind != SSIS_VARIABLES_TOOL_WINDOW_KIND)
                    {
                        return;                                                         //if not the variables window
                    }
                }
                catch //ObjectKind property blows up on some windows
                {
                    return;
                }

                //they've highlighted the Variables window, so add the extra toolbar buttons
                //find a package designer window
                IDesignerHost designer = null;
                foreach (Window w in this.ApplicationObject.Windows)
                {
                    try
                    {
                        designer = w.Object as IDesignerHost;
                        if (designer == null)
                        {
                            continue;
                        }
                        ProjectItem pi = w.ProjectItem;
                        if (pi != null && !(pi.Name.ToLower().EndsWith(".dtsx")))
                        {
                            designer = null;
                            continue;
                        }
                    }
                    catch
                    {
                        continue;
                    }

                    IDesignerToolWindowService service = (IDesignerToolWindowService)designer.GetService(typeof(IDesignerToolWindowService));
                    if (service == null)
                    {
                        continue;
                    }
                    IDesignerToolWindow toolWindow = service.GetToolWindow(new Guid(SSIS_VARIABLES_TOOL_WINDOW_KIND), 0);
                    if (toolWindow == null)
                    {
                        continue;
                    }
                    variablesToolWindowControl = (UserControl)toolWindow.Client; //actually Microsoft.DataTransformationServices.Design.VariablesToolWindow which is internal

                    serviceProvider = designer;
                    changesvc       = (IComponentChangeService)designer.GetService(typeof(IComponentChangeService));

                    // Get grid and toolbar
#if DENALI || SQL2014
                    // "tableLayoutPanelMain" - "tableLayoutPanelVariable" - "dlgGridControl1" | "toolBarVariable"
                    grid = (DlgGridControl)variablesToolWindowControl.Controls[0].Controls[0].Controls[0];
                    ToolBar toolbar = (ToolBar)variablesToolWindowControl.Controls[0].Controls[0].Controls[1];
#else
                    grid = (DlgGridControl)variablesToolWindowControl.Controls["dlgGridControl1"];
                    ToolBar toolbar = (ToolBar)variablesToolWindowControl.Controls["toolBar1"];
#endif

                    // If buttons already added, no need to do it again so exit
                    if (this.moveCopyButton != null && toolbar.Buttons.Contains(this.moveCopyButton))
                    {
                        return;
                    }

#if DENALI || SQL2014
                    // When you click the edit expression ellipsis button in the variables grid, we want to use our own expression editor, not the MS one.
                    // The following section removes their event handler and adds our own
                    // Get the type of the variables grid, and get the MouseButtonClicked clicked event info
                    // Then get the private dlgGridControl1_MouseButtonClicked event handler method, and get an instance delegate
                    Type gridType = grid.GetType();
                    System.Reflection.EventInfo eventInfo = gridType.GetEvent("MouseButtonClicked");
                    Type       handlerType  = eventInfo.EventHandlerType;
                    MethodInfo legacyMethod = variablesToolWindowControl.GetType().GetMethod("dlgGridControl1_MouseButtonClicked", BindingFlags.NonPublic | BindingFlags.Instance);
                    Delegate   del          = Delegate.CreateDelegate(handlerType, variablesToolWindowControl, legacyMethod, false);

                    // Finally remove the interal MS event handler from the event, and add our own
                    eventInfo.RemoveEventHandler(grid, del);
                    grid.MouseButtonClicked += grid_MouseButtonClicked;
#endif

                    // Now build tool bar buttons and add them
                    ToolBarButton separator = new ToolBarButton();
                    separator.Style = ToolBarButtonStyle.Separator;
                    toolbar.Buttons.Add(separator);

                    // Move/Copy button
                    this.moveCopyButton             = new ToolBarButton();
                    this.moveCopyButton.Style       = ToolBarButtonStyle.PushButton;
                    this.moveCopyButton.ToolTipText = "Move/Copy Variables to New Scope (BIDS Helper)";
                    toolbar.Buttons.Add(this.moveCopyButton);
                    toolbar.ImageList.Images.Add(BIDSHelper.Resources.Common.Copy);
                    this.moveCopyButton.ImageIndex = toolbar.ImageList.Images.Count - 1;

                    // Edit Variable Expression button
                    this.editExpressionButton             = new ToolBarButton();
                    this.editExpressionButton.Style       = ToolBarButtonStyle.PushButton;
                    this.editExpressionButton.ToolTipText = "Edit Variable Expression (BIDS Helper)";
                    toolbar.Buttons.Add(this.editExpressionButton);
                    toolbar.ImageList.Images.Add(BIDSHelper.Resources.Versioned.EditVariable);
                    this.editExpressionButton.ImageIndex = toolbar.ImageList.Images.Count - 1;

#if DENALI || SQL2014
                    // Find References button
                    this.findReferencesButton             = new ToolBarButton();
                    this.findReferencesButton.Style       = ToolBarButtonStyle.PushButton;
                    this.findReferencesButton.ToolTipText = "Find Variable References (BIDS Helper)";
                    toolbar.Buttons.Add(this.findReferencesButton);
                    toolbar.ImageList.Images.Add(BIDSHelper.Resources.Versioned.VariableFindReferences);
                    this.findReferencesButton.ImageIndex = toolbar.ImageList.Images.Count - 1;

                    // Find Unused button
                    this.findUnusedButton             = new ToolBarButton();
                    this.findUnusedButton.Style       = ToolBarButtonStyle.PushButton;
                    this.findUnusedButton.ToolTipText = "Find Unused Variables (BIDS Helper)";
                    toolbar.Buttons.Add(this.findUnusedButton);
                    toolbar.ImageList.Images.Add(BIDSHelper.Resources.Versioned.VariableFindUnused);
                    this.findUnusedButton.ImageIndex = toolbar.ImageList.Images.Count - 1;
#endif

                    toolbar.ButtonClick += new ToolBarButtonClickEventHandler(toolbar_ButtonClick);
                    toolbar.Wrappable    = false;

                    grid.SelectionChanged += new SelectionChangedEventHandler(grid_SelectionChanged);
                    grid.Invalidated      += new InvalidateEventHandler(grid_Invalidated);

                    SetButtonEnabled();
                    RefreshHighlights();
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n\r\n" + ex.StackTrace, DefaultMessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #32
0
 public ToolBarButtonProvider(ToolBarButton toolBarButton) : base(toolBarButton)
 {
     this.toolBarButton = toolBarButton;
     this.style         = toolBarButton.Style;
 }
Example #33
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
     this.toolBar      = new ToolBar();
     this.btnViewUsers = new ToolBarButton();
     this.btnEditUsers = new ToolBarButton();
     this.toolBoxIcons = new ImageList(this.components);
     this.lstViewUsers = new ListView();
     this.colUserName  = new ColumnHeader();
     this.colUserRole  = new ColumnHeader();
     this.colUserId    = new ColumnHeader();
     this.SuspendLayout();
     //
     // toolBar
     //
     this.toolBar.Buttons.AddRange(new ToolBarButton[] {
         this.btnViewUsers,
         this.btnEditUsers
     });
     this.toolBar.DropDownArrows = true;
     this.toolBar.ImageList      = this.toolBoxIcons;
     this.toolBar.Location       = new Point(0, 0);
     this.toolBar.Name           = "toolBar";
     this.toolBar.ShowToolTips   = true;
     this.toolBar.Size           = new Size(424, 28);
     this.toolBar.TabIndex       = 0;
     this.toolBar.ButtonClick   += new ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
     //
     // btnViewUsers
     //
     this.btnViewUsers.ImageIndex  = 0;
     this.btnViewUsers.Tag         = "view";
     this.btnViewUsers.ToolTipText = "Вывести список пользователей";
     //
     // btnEditUsers
     //
     this.btnEditUsers.ImageIndex  = 1;
     this.btnEditUsers.Tag         = "edit";
     this.btnEditUsers.ToolTipText = "Редактировать роль пользователя";
     //
     // toolBoxIcons
     //
     this.toolBoxIcons.ImageSize        = new Size(16, 16);
     this.toolBoxIcons.ImageStream      = ((ImageListStreamer)(resources.GetObject("toolBoxIcons.ImageStream")));
     this.toolBoxIcons.TransparentColor = Color.Transparent;
     //
     // lstViewUsers
     //
     this.lstViewUsers.Columns.AddRange(new ColumnHeader[] {
         this.colUserName,
         this.colUserRole,
         this.colUserId
     });
     this.lstViewUsers.Cursor         = Cursors.Hand;
     this.lstViewUsers.Dock           = DockStyle.Fill;
     this.lstViewUsers.FullRowSelect  = true;
     this.lstViewUsers.GridLines      = true;
     this.lstViewUsers.Location       = new Point(0, 28);
     this.lstViewUsers.MultiSelect    = false;
     this.lstViewUsers.Name           = "lstViewUsers";
     this.lstViewUsers.Size           = new Size(424, 238);
     this.lstViewUsers.SmallImageList = this.toolBoxIcons;
     this.lstViewUsers.TabIndex       = 1;
     this.lstViewUsers.View           = View.Details;
     //
     // colUserName
     //
     this.colUserName.Text  = "Имя пользователя";
     this.colUserName.Width = 125;
     //
     // colUserRole
     //
     this.colUserRole.Text  = "Роль пользователя";
     this.colUserRole.Width = 125;
     //
     // colUserId
     //
     this.colUserId.Text  = "Уникальный идентификатор";
     this.colUserId.Width = 175;
     //
     // MainForm
     //
     this.AutoScaleBaseSize = new Size(5, 13);
     this.ClientSize        = new Size(424, 266);
     this.Controls.Add(this.lstViewUsers);
     this.Controls.Add(this.toolBar);
     this.Icon  = ((Icon)(resources.GetObject("$this.Icon")));
     this.Name  = "MainForm";
     this.Text  = "Ролевая безопасность";
     this.Load += new EventHandler(this.MainForm_Load);
     this.ResumeLayout(false);
 }
        public void Ctor_ToolBarButton(ToolBarButton button)
        {
            var e = new ToolBarButtonClickEventArgs(button);

            Assert.Equal(button, e.Button);
        }
Example #35
0
        private void InitializeComponent()
        {
            this.components = (IContainer) new Container();
            ResourceManager resourceManager = new ResourceManager(typeof(AnnotationPage));

            this.ToolbarImages  = new ImageList(this.components);
            this.ToolBar        = new ToolBar();
            this.TextBtn        = new ToolBarButton();
            this.LinkBtn        = new ToolBarButton();
            this.SketchBtn      = new ToolBarButton();
            this.AnnotationList = new ListView();
            this.AnnotationHdr  = new ColumnHeader();
            this.SourceHdr      = new ColumnHeader();
            this.AnnotationMenu = new ContextMenu();
            this.OpenAnnotation = new MenuItem();
            this.OpenSource     = new MenuItem();
            this.Sep1           = new ToolBarButton();
            this.ExportBtn      = new ToolBarButton();
            this.SuspendLayout();
            this.ToolbarImages.ColorDepth       = ColorDepth.Depth8Bit;
            this.ToolbarImages.ImageSize        = new Size(16, 16);
            this.ToolbarImages.ImageStream      = (ImageListStreamer)resourceManager.GetObject("ToolbarImages.ImageStream");
            this.ToolbarImages.TransparentColor = Color.Magenta;
            this.ToolBar.Appearance             = ToolBarAppearance.Flat;
            this.ToolBar.Buttons.AddRange(new ToolBarButton[5]
            {
                this.TextBtn,
                this.LinkBtn,
                this.SketchBtn,
                this.Sep1,
                this.ExportBtn
            });
            this.ToolBar.DropDownArrows = true;
            this.ToolBar.ImageList      = this.ToolbarImages;
            this.ToolBar.Name           = "ToolBar";
            this.ToolBar.ShowToolTips   = true;
            this.ToolBar.Size           = new Size(552, 25);
            this.ToolBar.TabIndex       = 0;
            this.ToolBar.ButtonClick   += new ToolBarButtonClickEventHandler(this.ToolBar_ButtonClick);
            this.TextBtn.ImageIndex     = 0;
            this.TextBtn.ToolTipText    = "Show Text Annotations";
            this.LinkBtn.ImageIndex     = 1;
            this.LinkBtn.ToolTipText    = "Show Link Annotations";
            this.SketchBtn.ImageIndex   = 2;
            this.SketchBtn.ToolTipText  = "Show Sketch Annotations";
            this.AnnotationList.Columns.AddRange(new ColumnHeader[2]
            {
                this.AnnotationHdr,
                this.SourceHdr
            });
            this.AnnotationList.ContextMenu   = this.AnnotationMenu;
            this.AnnotationList.Dock          = DockStyle.Fill;
            this.AnnotationList.FullRowSelect = true;
            this.AnnotationList.Location      = new Point(0, 25);
            this.AnnotationList.Name          = "AnnotationList";
            this.AnnotationList.Size          = new Size(552, 231);
            this.AnnotationList.Sorting       = SortOrder.Ascending;
            this.AnnotationList.TabIndex      = 1;
            this.AnnotationList.View          = View.Details;
            this.AnnotationList.MouseDown    += new MouseEventHandler(this.AnnotationList_MouseDown);
            this.AnnotationList.DoubleClick  += new EventHandler(this.AnnotationList_DoubleClick);
            this.AnnotationList.ColumnClick  += new ColumnClickEventHandler(this.AnnotationList_ColumnClick);
            this.AnnotationHdr.Text           = "Annotation";
            this.AnnotationHdr.Width          = 250;
            this.SourceHdr.Text  = "Source";
            this.SourceHdr.Width = 120;
            this.AnnotationMenu.MenuItems.AddRange(new MenuItem[2]
            {
                this.OpenAnnotation,
                this.OpenSource
            });
            this.OpenAnnotation.Index  = 0;
            this.OpenAnnotation.Text   = "Open Annotation";
            this.OpenAnnotation.Click += new EventHandler(this.OpenAnnotation_Click);
            this.OpenSource.Index      = 1;
            this.OpenSource.Text       = "Open Source";
            this.OpenSource.Click     += new EventHandler(this.OpenSource_Click);
            this.Sep1.Style            = ToolBarButtonStyle.Separator;
            this.ExportBtn.ImageIndex  = 3;
            this.ExportBtn.ToolTipText = "Export Annotations";
            this.Controls.AddRange(new Control[2]
            {
                (Control)this.AnnotationList,
                (Control)this.ToolBar
            });
            this.Name = nameof(AnnotationPage);
            this.Size = new Size(552, 256);
            this.ResumeLayout(false);
        }
Example #36
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CatalogExplorerForm));
     this.tbTools     = new System.Windows.Forms.ToolBar();
     this.btnServers  = new System.Windows.Forms.ToolBarButton();
     this.mnuServers  = new System.Windows.Forms.ContextMenu();
     this.btnView     = new System.Windows.Forms.ToolBarButton();
     this.btnDelete   = new System.Windows.Forms.ToolBarButton();
     this.btnRefresh  = new System.Windows.Forms.ToolBarButton();
     this.panel1      = new System.Windows.Forms.Panel();
     this.lvMembers   = new System.Windows.Forms.ListView();
     this.objName     = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.objType     = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.objDesc     = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.objCreated  = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.objModified = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
     this.ctlSplitter = new System.Windows.Forms.Splitter();
     this.tvLibsCats  = new System.Windows.Forms.TreeView();
     this.statusBar   = new System.Windows.Forms.StatusBar();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // tbTools
     //
     resources.ApplyResources(this.tbTools, "tbTools");
     this.tbTools.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.btnServers,
         this.btnView,
         this.btnDelete,
         this.btnRefresh
     });
     this.tbTools.Name    = "tbTools";
     this.tbTools.TabStop = true;
     //
     // btnServers
     //
     this.btnServers.DropDownMenu = this.mnuServers;
     this.btnServers.Name         = "btnServers";
     this.btnServers.Style        = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
     resources.ApplyResources(this.btnServers, "btnServers");
     //
     // btnView
     //
     this.btnView.Name = "btnView";
     resources.ApplyResources(this.btnView, "btnView");
     //
     // btnDelete
     //
     this.btnDelete.Name = "btnDelete";
     resources.ApplyResources(this.btnDelete, "btnDelete");
     //
     // btnRefresh
     //
     this.btnRefresh.Name = "btnRefresh";
     resources.ApplyResources(this.btnRefresh, "btnRefresh");
     //
     // panel1
     //
     this.panel1.Controls.Add(this.lvMembers);
     this.panel1.Controls.Add(this.ctlSplitter);
     this.panel1.Controls.Add(this.tvLibsCats);
     this.panel1.Controls.Add(this.statusBar);
     resources.ApplyResources(this.panel1, "panel1");
     this.panel1.Name = "panel1";
     //
     // lvMembers
     //
     this.lvMembers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this.objName,
         this.objType,
         this.objDesc,
         this.objCreated,
         this.objModified
     });
     resources.ApplyResources(this.lvMembers, "lvMembers");
     this.lvMembers.FullRowSelect = true;
     this.lvMembers.MultiSelect   = false;
     this.lvMembers.Name          = "lvMembers";
     this.lvMembers.UseCompatibleStateImageBehavior = false;
     this.lvMembers.View          = System.Windows.Forms.View.Details;
     this.lvMembers.ItemActivate += new System.EventHandler(this.OnItemDoubleClicked);
     this.lvMembers.DoubleClick  += new System.EventHandler(this.OnItemDoubleClicked);
     //
     // objName
     //
     resources.ApplyResources(this.objName, "objName");
     //
     // objType
     //
     resources.ApplyResources(this.objType, "objType");
     //
     // objDesc
     //
     resources.ApplyResources(this.objDesc, "objDesc");
     //
     // objCreated
     //
     resources.ApplyResources(this.objCreated, "objCreated");
     //
     // objModified
     //
     resources.ApplyResources(this.objModified, "objModified");
     //
     // ctlSplitter
     //
     resources.ApplyResources(this.ctlSplitter, "ctlSplitter");
     this.ctlSplitter.Name    = "ctlSplitter";
     this.ctlSplitter.TabStop = false;
     //
     // tvLibsCats
     //
     resources.ApplyResources(this.tvLibsCats, "tvLibsCats");
     this.tvLibsCats.Name         = "tvLibsCats";
     this.tvLibsCats.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.OnTreeNodeSelected);
     //
     // statusBar
     //
     resources.ApplyResources(this.statusBar, "statusBar");
     this.statusBar.Name = "statusBar";
     //
     // CatalogExplorerForm
     //
     resources.ApplyResources(this, "$this");
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.tbTools);
     this.Name = "CatalogExplorerForm";
     this.panel1.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
 private void InitializeControl(ToolBarButton ctl, KeyValuePair<ToolBarButton, CslaActionExtenderProperties> pair)
 {
   if (pair.Value.DisableWhenUseless || (pair.Value.DisableWhenClean && !ctl.Enabled))
   {
     ISavable businessObject = GetBusinessObject();
     if (businessObject != null)
     {
       ITrackStatus trackableObject = businessObject as ITrackStatus;
       if (trackableObject != null)
       {
         if (pair.Value.ActionType == CslaFormAction.Cancel || pair.Value.DisableWhenClean)
           ChangeEnabled(ctl, trackableObject.IsNew || trackableObject.IsDirty || trackableObject.IsDeleted);
         if (pair.Value.ActionType == CslaFormAction.Save)
           ChangeEnabled(ctl, (trackableObject.IsNew || trackableObject.IsDirty || trackableObject.IsDeleted)
             && trackableObject.IsValid);
       }
     }
   }
 }
Example #38
0
        // Do this in a separate method so SelectTool can override it as
        // a no-op, but still get the BaseShape.OnBuildToolBar logic.
        protected virtual void BuildToolBar(Gtk.Toolbar tb)
        {
            if (brush_width_label == null)
            {
                brush_width_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Brush width")));
            }

            tb.AppendItem(brush_width_label);

            if (brush_width_minus == null)
            {
                brush_width_minus          = new ToolBarButton("Toolbar.MinusButton.png", "", Catalog.GetString("Decrease brush size"));
                brush_width_minus.Clicked += MinusButtonClickedEvent;
            }

            tb.AppendItem(brush_width_minus);

            if (brush_width == null)
            {
                brush_width = new ToolBarComboBox(65, 1, true, "1", "2", "3", "4", "5", "6", "7", "8", "9",
                                                  "10", "11", "12", "13", "14", "15", "20", "25", "30", "35",
                                                  "40", "45", "50", "55");
            }

            tb.AppendItem(brush_width);

            if (brush_width_plus == null)
            {
                brush_width_plus          = new ToolBarButton("Toolbar.PlusButton.png", "", Catalog.GetString("Increase brush size"));
                brush_width_plus.Clicked += PlusButtonClickedEvent;
            }

            tb.AppendItem(brush_width_plus);

            if (ShowStrokeComboBox)
            {
                if (fill_sep == null)
                {
                    fill_sep = new Gtk.SeparatorToolItem();
                }

                tb.AppendItem(fill_sep);

                if (fill_label == null)
                {
                    fill_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Fill Style")));
                }

                tb.AppendItem(fill_label);

                if (fill_button == null)
                {
                    fill_button = new ToolBarDropDownButton();

                    fill_button.AddItem(Catalog.GetString("Outline Shape"), "ShapeTool.Outline.png", 0);
                    fill_button.AddItem(Catalog.GetString("Fill Shape"), "ShapeTool.Fill.png", 1);
                    fill_button.AddItem(Catalog.GetString("Fill and Outline Shape"), "ShapeTool.OutlineFill.png", 2);
                }

                tb.AppendItem(fill_button);
            }
        }
 private Form GetParentForm(ToolBarButton thisToolBarButton)
 {
   return GetParentForm(thisToolBarButton.ToolBar);
 }
Example #40
0
        private void InitializeComponent()
        {
            this.components = (IContainer) new Container();
            ResourceManager resourceManager = new ResourceManager(typeof(SearchPage));

            this.ToolbarImages     = new ImageList(this.components);
            this.ResultContextMenu = new ContextMenu();
            this.ResultOpen        = new MenuItem();
            this.ResultProperties  = new MenuItem();
            this.TypePages         = new Crownwood.Magic.Controls.TabControl();
            this.StandardPage      = new Crownwood.Magic.Controls.TabPage();
            this.ResultsList       = new ListView();
            this.NameHdr           = new ColumnHeader();
            this.TypeHdr           = new ColumnHeader();
            this.DetailsHdr        = new ColumnHeader();
            this.Splitter          = new Splitter();
            this.SearchPanel       = new Panel();
            this.NegateBox         = new CheckBox();
            this.CaseSensitiveBox  = new CheckBox();
            this.SearchTextBox     = new TextBox();
            this.SearchForLbl      = new Label();
            this.NewSearchBtn      = new ToolBarButton();
            this.ToolBar           = new ToolBar();
            this.StandardPage.SuspendLayout();
            this.SearchPanel.SuspendLayout();
            this.SuspendLayout();
            this.ToolbarImages.ColorDepth       = ColorDepth.Depth8Bit;
            this.ToolbarImages.ImageSize        = new Size(16, 16);
            this.ToolbarImages.ImageStream      = (ImageListStreamer)resourceManager.GetObject("ToolbarImages.ImageStream");
            this.ToolbarImages.TransparentColor = Color.Magenta;
            this.ResultContextMenu.MenuItems.AddRange(new MenuItem[2]
            {
                this.ResultOpen,
                this.ResultProperties
            });
            this.ResultOpen.Index        = 0;
            this.ResultOpen.Text         = "Open Result Item";
            this.ResultOpen.Click       += new EventHandler(this.ResultOpen_Click);
            this.ResultProperties.Index  = 1;
            this.ResultProperties.Text   = "Result Item Properties";
            this.ResultProperties.Click += new EventHandler(this.ResultProperties_Click);
            this.TypePages.Dock          = DockStyle.Fill;
            this.TypePages.HideTabsMode  = Crownwood.Magic.Controls.TabControl.HideTabsModes.ShowAlways;
            this.TypePages.Location      = new Point(0, 25);
            this.TypePages.Name          = "TypePages";
            this.TypePages.SelectedIndex = 0;
            this.TypePages.SelectedTab   = this.StandardPage;
            this.TypePages.Size          = new Size(560, 239);
            this.TypePages.TabIndex      = 4;
            this.TypePages.TabPages.AddRange(new Crownwood.Magic.Controls.TabPage[1]
            {
                this.StandardPage
            });
            this.StandardPage.Controls.AddRange(new Control[3]
            {
                (Control)this.ResultsList,
                (Control)this.Splitter,
                (Control)this.SearchPanel
            });
            this.StandardPage.Name     = "StandardPage";
            this.StandardPage.Size     = new Size(560, 214);
            this.StandardPage.TabIndex = 0;
            this.StandardPage.Title    = "Standard";
            this.ResultsList.Columns.AddRange(new ColumnHeader[3]
            {
                this.NameHdr,
                this.TypeHdr,
                this.DetailsHdr
            });
            this.ResultsList.ContextMenu   = this.ResultContextMenu;
            this.ResultsList.Dock          = DockStyle.Fill;
            this.ResultsList.FullRowSelect = true;
            this.ResultsList.Location      = new Point(195, 0);
            this.ResultsList.Name          = "ResultsList";
            this.ResultsList.Size          = new Size(365, 214);
            this.ResultsList.Sorting       = SortOrder.Ascending;
            this.ResultsList.TabIndex      = 2;
            this.ResultsList.View          = View.Details;
            this.ResultsList.MouseDown    += new MouseEventHandler(this.SimpleResultsList_MouseDown);
            this.ResultsList.DoubleClick  += new EventHandler(this.ResultsList_DoubleClick);
            this.ResultsList.ColumnClick  += new ColumnClickEventHandler(this.SimpleResultsList_ColumnClick);
            this.NameHdr.Text            = "Result";
            this.NameHdr.Width           = 150;
            this.TypeHdr.Text            = "Type";
            this.TypeHdr.Width           = 90;
            this.DetailsHdr.Text         = "Source";
            this.DetailsHdr.Width        = 90;
            this.Splitter.Location       = new Point(192, 0);
            this.Splitter.Name           = "Splitter";
            this.Splitter.Size           = new Size(3, 214);
            this.Splitter.TabIndex       = 1;
            this.Splitter.TabStop        = false;
            this.SearchPanel.BorderStyle = BorderStyle.Fixed3D;
            this.SearchPanel.Controls.AddRange(new Control[4]
            {
                (Control)this.NegateBox,
                (Control)this.CaseSensitiveBox,
                (Control)this.SearchTextBox,
                (Control)this.SearchForLbl
            });
            this.SearchPanel.Dock                 = DockStyle.Left;
            this.SearchPanel.Name                 = "SearchPanel";
            this.SearchPanel.Size                 = new Size(192, 214);
            this.SearchPanel.TabIndex             = 0;
            this.NegateBox.Anchor                 = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            this.NegateBox.Location               = new Point(16, 120);
            this.NegateBox.Name                   = "NegateBox";
            this.NegateBox.Size                   = new Size(152, 32);
            this.NegateBox.TabIndex               = 3;
            this.NegateBox.Text                   = "Search for items which do NOT contain this text";
            this.NegateBox.CheckedChanged        += new EventHandler(this.NegateBox_CheckedChanged);
            this.CaseSensitiveBox.Font            = new Font("Tahoma", 11f, FontStyle.Regular, GraphicsUnit.World);
            this.CaseSensitiveBox.Location        = new Point(16, 88);
            this.CaseSensitiveBox.Name            = "CaseSensitiveBox";
            this.CaseSensitiveBox.Size            = new Size(96, 24);
            this.CaseSensitiveBox.TabIndex        = 2;
            this.CaseSensitiveBox.Text            = "Case-sensitive";
            this.CaseSensitiveBox.CheckedChanged += new EventHandler(this.CaseSensitiveBox_CheckedChanged);
            this.SearchTextBox.Anchor             = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            this.SearchTextBox.Location           = new Point(16, 56);
            this.SearchTextBox.Name               = "SearchTextBox";
            this.SearchTextBox.Size               = new Size(156, 21);
            this.SearchTextBox.TabIndex           = 1;
            this.SearchTextBox.Text               = "";
            this.SearchTextBox.TextChanged       += new EventHandler(this.SearchTextBox_TextChanged);
            this.SearchForLbl.Anchor              = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            this.SearchForLbl.Location            = new Point(16, 16);
            this.SearchForLbl.Name                = "SearchForLbl";
            this.SearchForLbl.Size                = new Size(152, 32);
            this.SearchForLbl.TabIndex            = 0;
            this.SearchForLbl.Text                = "Search for items containing the following text:";
            this.SearchForLbl.TextAlign           = ContentAlignment.MiddleLeft;
            this.NewSearchBtn.ImageIndex          = 0;
            this.NewSearchBtn.ToolTipText         = "New Search";
            this.ToolBar.Appearance               = ToolBarAppearance.Flat;
            this.ToolBar.Buttons.AddRange(new ToolBarButton[1]
            {
                this.NewSearchBtn
            });
            this.ToolBar.ButtonSize     = new Size(23, 22);
            this.ToolBar.DropDownArrows = true;
            this.ToolBar.Font           = new Font("Tahoma", 11f, FontStyle.Regular, GraphicsUnit.World);
            this.ToolBar.ImageList      = this.ToolbarImages;
            this.ToolBar.Name           = "ToolBar";
            this.ToolBar.ShowToolTips   = true;
            this.ToolBar.Size           = new Size(560, 25);
            this.ToolBar.TabIndex       = 0;
            this.ToolBar.ButtonClick   += new ToolBarButtonClickEventHandler(this.ToolBar_ButtonClick);
            this.Controls.AddRange(new Control[2]
            {
                (Control)this.TypePages,
                (Control)this.ToolBar
            });
            this.Font = new Font("Tahoma", 11f, FontStyle.Regular, GraphicsUnit.World);
            this.Name = nameof(SearchPage);
            this.Size = new Size(560, 264);
            this.StandardPage.ResumeLayout(false);
            this.SearchPanel.ResumeLayout(false);
            this.ResumeLayout(false);
        }
 public void SetActionType(ToolBarButton ctl, CslaFormAction value)
 {
   if (_sources.ContainsKey(ctl))
     _sources[ctl].ActionType = value;
   else
   {
     CslaActionExtenderProperties props = new CslaActionExtenderProperties();
     props.ActionType = value;
     _sources.Add(ctl, props);
   }
 }
Example #42
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditForm));
     this.statusBar1      = new System.Windows.Forms.StatusBar();
     this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
     this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
     this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
     this.sDoc            = new Alsing.SourceCode.SyntaxDocument(this.components);
     this.tbrSettings     = new System.Windows.Forms.ToolBar();
     this.btnWhitespace   = new System.Windows.Forms.ToolBarButton();
     this.btnTabGuides    = new System.Windows.Forms.ToolBarButton();
     this.btnFolding      = new System.Windows.Forms.ToolBarButton();
     this.btnSettings     = new System.Windows.Forms.ToolBarButton();
     this.imlIcons        = new System.Windows.Forms.ImageList(this.components);
     this.sBox            = new Alsing.Windows.Forms.SyntaxBoxControl();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
     this.SuspendLayout();
     //
     // statusBar1
     //
     this.statusBar1.Location = new System.Drawing.Point(0, 471);
     this.statusBar1.Name     = "statusBar1";
     this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
         this.statusBarPanel1,
         this.statusBarPanel2,
         this.statusBarPanel3
     });
     this.statusBar1.ShowPanels = true;
     this.statusBar1.Size       = new System.Drawing.Size(504, 22);
     this.statusBar1.TabIndex   = 1;
     //
     // statusBarPanel1
     //
     this.statusBarPanel1.Name  = "statusBarPanel1";
     this.statusBarPanel1.Width = 200;
     //
     // statusBarPanel2
     //
     this.statusBarPanel2.Name  = "statusBarPanel2";
     this.statusBarPanel2.Width = 200;
     //
     // statusBarPanel3
     //
     this.statusBarPanel3.Name = "statusBarPanel3";
     //
     // sDoc
     //
     this.sDoc.Lines = new string[] {
         "abc"
     };
     this.sDoc.MaxUndoBufferSize = 1000;
     this.sDoc.Modified          = false;
     this.sDoc.UndoStep          = 0;
     this.sDoc.Change           += new System.EventHandler(this.sDoc_Change);
     this.sDoc.ModifiedChanged  += new System.EventHandler(this.sDoc_ModifiedChanged);
     //
     // tbrSettings
     //
     this.tbrSettings.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
     this.tbrSettings.AutoSize   = false;
     this.tbrSettings.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
         this.btnWhitespace,
         this.btnTabGuides,
         this.btnFolding,
         this.btnSettings
     });
     this.tbrSettings.Divider        = false;
     this.tbrSettings.Dock           = System.Windows.Forms.DockStyle.Left;
     this.tbrSettings.DropDownArrows = true;
     this.tbrSettings.ImageList      = this.imlIcons;
     this.tbrSettings.Location       = new System.Drawing.Point(0, 0);
     this.tbrSettings.Name           = "tbrSettings";
     this.tbrSettings.ShowToolTips   = true;
     this.tbrSettings.Size           = new System.Drawing.Size(25, 471);
     this.tbrSettings.TabIndex       = 2;
     this.tbrSettings.ButtonClick   += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbrSettings_ButtonClick);
     //
     // btnWhitespace
     //
     this.btnWhitespace.ImageIndex  = 1;
     this.btnWhitespace.Name        = "btnWhitespace";
     this.btnWhitespace.Style       = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
     this.btnWhitespace.ToolTipText = "Toggle Whitespace On/Off";
     //
     // btnTabGuides
     //
     this.btnTabGuides.ImageIndex  = 0;
     this.btnTabGuides.Name        = "btnTabGuides";
     this.btnTabGuides.Style       = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
     this.btnTabGuides.ToolTipText = "Toggle Tab guides On/Off";
     //
     // btnFolding
     //
     this.btnFolding.ImageIndex  = 2;
     this.btnFolding.Name        = "btnFolding";
     this.btnFolding.Pushed      = true;
     this.btnFolding.Style       = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
     this.btnFolding.ToolTipText = "Toggle Folding On/Off";
     //
     // btnSettings
     //
     this.btnSettings.Name = "btnSettings";
     this.btnSettings.Text = "S";
     //
     // imlIcons
     //
     this.imlIcons.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlIcons.ImageStream")));
     this.imlIcons.TransparentColor = System.Drawing.Color.Transparent;
     this.imlIcons.Images.SetKeyName(0, "");
     this.imlIcons.Images.SetKeyName(1, "");
     this.imlIcons.Images.SetKeyName(2, "");
     //
     // sBox
     //
     this.sBox.ActiveView           = Alsing.Windows.Forms.ActiveView.BottomRight;
     this.sBox.AutoListPosition     = null;
     this.sBox.AutoListSelectedText = "a123";
     this.sBox.AutoListVisible      = false;
     this.sBox.BackColor            = System.Drawing.Color.White;
     this.sBox.BorderStyle          = Alsing.Windows.Forms.BorderStyle.None;
     this.sBox.ChildBorderColor     = System.Drawing.Color.White;
     this.sBox.ChildBorderStyle     = Alsing.Windows.Forms.BorderStyle.None;
     this.sBox.CopyAsRTF            = false;
     this.sBox.Dock                 = System.Windows.Forms.DockStyle.Fill;
     this.sBox.Document             = this.sDoc;
     this.sBox.FontName             = "Courier new";
     this.sBox.ImeMode              = System.Windows.Forms.ImeMode.NoControl;
     this.sBox.InfoTipCount         = 1;
     this.sBox.InfoTipPosition      = null;
     this.sBox.InfoTipSelectedIndex = 1;
     this.sBox.InfoTipVisible       = false;
     this.sBox.Location             = new System.Drawing.Point(25, 0);
     this.sBox.LockCursorUpdate     = false;
     this.sBox.Name                 = "sBox";
     this.sBox.ScopeIndicatorColor  = System.Drawing.Color.Black;
     this.sBox.ShowScopeIndicator   = false;
     this.sBox.Size                 = new System.Drawing.Size(479, 471);
     this.sBox.SmoothScroll         = false;
     this.sBox.SplitviewH           = -4;
     this.sBox.SplitviewV           = -4;
     this.sBox.TabGuideColor        = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(219)))), ((int)(((byte)(214)))));
     this.sBox.TabIndex             = 3;
     this.sBox.Text                 = "syntaxBoxControl1";
     this.sBox.WhitespaceColor      = System.Drawing.SystemColors.ControlDark;
     //
     // EditForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(504, 493);
     this.Controls.Add(this.sBox);
     this.Controls.Add(this.tbrSettings);
     this.Controls.Add(this.statusBar1);
     this.Icon     = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name     = "EditForm";
     this.Text     = "EditForm";
     this.Closing += new System.ComponentModel.CancelEventHandler(this.EditForm_Closing);
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).EndInit();
     this.ResumeLayout(false);
 }
 public void SetPostSaveAction(ToolBarButton ctl, PostSaveActionType value)
 {
   if (_sources.ContainsKey(ctl))
     _sources[ctl].PostSaveAction = value;
   else
   {
     CslaActionExtenderProperties props = new CslaActionExtenderProperties();
     props.PostSaveAction = value;
     _sources.Add(ctl, props);
   }
 }
Example #44
0
        /// <summary>
        ///     Required method for Designer support - do not modify
        ///     the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            var resources = new System.Resources.ResourceManager(typeof(WorldMap));

            this.tBar   = new System.Windows.Forms.ToolBar();
            this.bBig   = new System.Windows.Forms.ToolBarButton();
            this.bMap0  = new System.Windows.Forms.ToolBarButton();
            this.bMap1  = new System.Windows.Forms.ToolBarButton();
            this.bMap2  = new System.Windows.Forms.ToolBarButton();
            this.bMap3  = new System.Windows.Forms.ToolBarButton();
            this.bClose = new System.Windows.Forms.ToolBarButton();
            this.Img    = new System.Windows.Forms.PictureBox();
            this.bMap4  = new System.Windows.Forms.ToolBarButton();
            this.SuspendLayout();
            //
            // tBar
            //
            this.tBar.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.tBar.Buttons.AddRange(
                new System.Windows.Forms.ToolBarButton[]
                { this.bBig, this.bMap0, this.bMap1, this.bMap2, this.bMap3, this.bMap4, this.bClose });
            this.tBar.ButtonSize     = new System.Drawing.Size(58, 18);
            this.tBar.DropDownArrows = true;
            this.tBar.Location       = new System.Drawing.Point(0, 0);
            this.tBar.Name           = "tBar";
            this.tBar.ShowToolTips   = true;
            this.tBar.Size           = new System.Drawing.Size(736, 29);
            this.tBar.TabIndex       = 0;
            this.tBar.Wrappable      = false;
            this.tBar.ButtonClick   += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tBar_ButtonClick);
            //
            // bBig
            //
            this.bBig.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
            this.bBig.Text  = "World.Big";
            //
            // bClose
            //
            this.bClose.Text = "Common.Exit";
            //
            // Img
            //
            this.Img.Location   = new System.Drawing.Point(0, 26);
            this.Img.Name       = "Img";
            this.Img.Size       = new System.Drawing.Size(736, 448);
            this.Img.TabIndex   = 1;
            this.Img.TabStop    = false;
            this.Img.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Img_MouseDown);
            //
            // WorldMap
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize        = new System.Drawing.Size(736, 479);
            this.Controls.Add(this.Img);
            this.Controls.Add(this.tBar);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox     = false;
            this.Name            = "WorldMap";
            this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text            = "World.WorldMap";
            this.Load           += new System.EventHandler(this.WorldMap_Load);
            this.ResumeLayout(false);
        }
 public void SetRebindAfterSave(ToolBarButton ctl, bool value)
 {
   if (_sources.ContainsKey(ctl))
     _sources[ctl].RebindAfterSave = value;
   else
   {
     CslaActionExtenderProperties props = new CslaActionExtenderProperties();
     props.RebindAfterSave = value;
     _sources.Add(ctl, props);
   }
 }
Example #46
0
        /// <summary>
        ///     Required method for Designer support - do not modify
        ///     the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            var resources = new System.Resources.ResourceManager(typeof(VisualClientList));

            this.tBar     = new System.Windows.Forms.ToolBar();
            this.map0     = new System.Windows.Forms.ToolBarButton();
            this.map1     = new System.Windows.Forms.ToolBarButton();
            this.map2     = new System.Windows.Forms.ToolBarButton();
            this.map3     = new System.Windows.Forms.ToolBarButton();
            this.bRefresh = new System.Windows.Forms.ToolBarButton();
            this.bExit    = new System.Windows.Forms.ToolBarButton();
            this.SuspendLayout();
            //
            // tBar
            //
            this.tBar.Buttons.AddRange(
                new System.Windows.Forms.ToolBarButton[] { this.map0, this.map1, this.map2, this.map3, this.bRefresh, this.bExit });
            this.tBar.DropDownArrows = true;
            this.tBar.Location       = new System.Drawing.Point(0, 0);
            this.tBar.Name           = "tBar";
            this.tBar.ShowToolTips   = true;
            this.tBar.Size           = new System.Drawing.Size(424, 28);
            this.tBar.TabIndex       = 0;
            this.tBar.TextAlign      = System.Windows.Forms.ToolBarTextAlign.Right;
            this.tBar.Wrappable      = false;
            this.tBar.ButtonClick   += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tBar_ButtonClick);
            //
            // map0
            //
            this.map0.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
            this.map0.Tag   = "0";
            this.map0.Text  = "One";
            //
            // map1
            //
            this.map1.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
            this.map1.Tag   = "1";
            //
            // map2
            //
            this.map2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
            this.map2.Tag   = "2";
            //
            // map3
            //
            this.map3.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
            this.map3.Tag   = "3";
            //
            // VisualClientList
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize        = new System.Drawing.Size(424, 357);
            this.Controls.Add(this.tBar);
            this.Icon       = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name       = "VisualClientList";
            this.Text       = "VisualClientList";
            this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.VisualClientList_MouseDown);
            this.Load      += new System.EventHandler(this.VisualClientList_Load);
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.VisualClientList_MouseMove);
            this.ResumeLayout(false);
        }
 public void SetDisableWhenUseless(ToolBarButton ctl, bool value)
 {
   if (_sources.ContainsKey(ctl))
     _sources[ctl].DisableWhenUseless = value;
   else
   {
     CslaActionExtenderProperties props = new CslaActionExtenderProperties();
     props.DisableWhenUseless = value;
     _sources.Add(ctl, props);
   }
 }
Example #48
0
        //==================================================================
        private void on_loaded(object sender, System.EventArgs e)
        {
            /**/
            var /*Rectangle*/ sr = Screen.GetWorkingArea(this);

            this.Width  = Convert.ToInt32(sr.Width * 0.8);
            this.Height = Convert.ToInt32(sr.Height * 0.8);
            int left = 1; // (sr.Width/2) - (this.Width/2);
            int top  = 1; // (sr.Height/2) - (this.Height/2);

            // Center the Form on the user's screen
            this.SetBounds(
                left, top, this.Width, this.Height, BoundsSpecified.All
                );
            this.Location = new Point(left, top);
            /**/

            // Add buttons to the tool bar
            ToolBarButton button1 = new ToolBarButton();
            ToolBarButton button2 = new ToolBarButton();
            ToolBarButton button3 = new ToolBarButton();
            ToolBarButton button4 = new ToolBarButton();
            ToolBarButton button5 = new ToolBarButton();
            ToolBarButton button6 = new ToolBarButton();

            ToolBarButton separator = new ToolBarButton();

            // Set the Text properties of the button controls.
            button1.Text = "&CAll";
            button2.Text = "Con&figure";
            button3.Text = "&Copy Output";
            button4.Text = "&Results";
            button5.Text = "&Exit";
            button6.Text = "&About";

            separator.Style = ToolBarButtonStyle.Separator;

            // Add the button controls to the ToolBar.
            toolBar.Buttons.Add(separator);
            toolBar.Buttons.Add(button1);               // 1
            toolBar.Buttons.Add(separator);
            toolBar.Buttons.Add(button2);               // 3 == Re-Configuration
            toolBar.Buttons.Add(separator);
            toolBar.Buttons.Add(button3);               // 5
            toolBar.Buttons.Add(separator);
            toolBar.Buttons.Add(button4);               // 7 == Result browser
            toolBar.Buttons.Add(separator);
            toolBar.Buttons.Add(button5);               // 9 == Exit
            toolBar.Buttons.Add(separator);
            toolBar.Buttons.Add(button6);               // 11 == About

            this.behind_ = new dbjept.Behind(this);
            this.behind_.on_form_activated(sender, e);

            Util.tooltip_to_control(this.output, "Double-click to erase this text");
            Util.tooltip_to_control(this.treeView1, "Test configuration");
            Util.tooltip_to_control(this.toolBar, "(c) 2003-2006 by DBJSOLUTIONS.COM\n\rAll rights reserved");
            Util.tooltip_to_control(this.toolBar, "(c) 2018 by DBJ.Systems \n\rAll rights reserved");

            // initial info for the output
            this.writeln(
                Environment.NewLine +
                System.Reflection.Assembly.GetExecutingAssembly().FullName +
                Environment.NewLine +
                "Corelib Version : " +
                dbj.fm.util.version() + Environment.NewLine +
                ".NET environment : " +
                System.Environment.Version.ToString(4)
                );
#if DEBUG
            string debug_info = string.Format(
                "AppDomain friendly name : [{0}]" + NL +
                "Base directory : [{2}]" + NL +
                "Files shadow copied : [{4}]" + NL +
                "Relative search path : [{1}]" + NL +
                "Dynamic directory : [{3}]" + NL,
                AppDomain.CurrentDomain.FriendlyName,
                AppDomain.CurrentDomain.RelativeSearchPath,
                AppDomain.CurrentDomain.BaseDirectory,
                AppDomain.CurrentDomain.DynamicDirectory,
                (AppDomain.CurrentDomain.ShadowCopyFiles ? "YES" : "NO"));
            // System.Diagnostics.Debug.WriteLine("") ;
            // System.Diagnostics.Debug.WriteLine( debug_info ) ;
            Behind.trace.info("Loaded and initialized the main form");
            this.writeln(debug_info);
#endif
        }
 public void SetCommandName(ToolBarButton ctl, string value)
 {
   if (_sources.ContainsKey(ctl))
     _sources[ctl].CommandName = value;
   else
   {
     CslaActionExtenderProperties props = new CslaActionExtenderProperties();
     props.CommandName = value;
     _sources.Add(ctl, props);
   }
 }
        public override void OnWindowActivated(Window GotFocus, Window LostFocus)
        {
            try
            {
                package.Log.Debug("CalcHelpersPlugin OnWindowActivated Fired");
                if (GotFocus == null)
                {
                    return;
                }
                IDesignerHost designer = GotFocus.Object as IDesignerHost;
                if (designer == null)
                {
                    return;
                }
                ProjectItem pi = GotFocus.ProjectItem;
                if ((pi == null) || (!(pi.Object is Cube)))
                {
                    return;
                }
                EditorWindow   win     = (EditorWindow)designer.GetService(typeof(IComponentNavigator));
                VsStyleToolBar toolbar = (VsStyleToolBar)win.SelectedView.GetType().InvokeMember("ToolBar", getflags, null, win.SelectedView, null);

                IntPtr ptr     = win.Handle;
                string sHandle = ptr.ToInt64().ToString();

                if (!windowHandlesFixedForCalcProperties.ContainsKey(sHandle))
                {
                    windowHandlesFixedForCalcProperties.Add(sHandle, win);
                    win.ActiveViewChanged += new EventHandler(win_ActiveViewChanged);
                }

                if (win.SelectedView.MenuItemCommandID.ID == (int)BIDSViewMenuItemCommandID.Calculations)
                //if (win.SelectedView.Caption == "Calculations")
                {
                    int  iMicrosoftCalcPropertiesIndex = 0;
                    bool bFlipScriptViewButton         = false;
                    foreach (ToolBarButton b in toolbar.Buttons)
                    {
                        MenuCommandToolBarButton tbb = b as MenuCommandToolBarButton;
                        if (tbb != null && tbb.AssociatedCommandID.ID == (int)BIDSToolbarButtonID.CalculationProperties)
                        //if (b.ToolTipText.StartsWith("Calculation Properties"))
                        {
                            if (b.Tag == null || b.Tag.ToString() != this.FullName + ".CommandProperties")
                            {
                                if (!toolbar.Buttons.ContainsKey(this.FullName + ".CommandProperties"))
                                {
                                    //if we haven't created it yet
                                    iMicrosoftCalcPropertiesIndex = toolbar.Buttons.IndexOf(b);
                                    b.Visible = false;

                                    newCalcPropButton             = new ToolBarButton();
                                    newCalcPropButton.ToolTipText = "Calculation Properties (BIDS Helper)";
                                    newCalcPropButton.Name        = this.FullName + ".CommandProperties";
                                    newCalcPropButton.Tag         = newCalcPropButton.Name;

                                    newCalcPropButton.ImageIndex = 12;
                                    newCalcPropButton.Enabled    = true;
                                    newCalcPropButton.Style      = ToolBarButtonStyle.PushButton;

                                    toolbar.ImageList.Images.Add(BIDSHelper.Resources.Common.DeployMdxScriptIcon);

                                    if (pi.Name.ToLower().EndsWith(".cube")) //only show feature if we're in offline mode
                                    {
                                        // TODO - does not disable if Deploy plugin is disabled after the button has been added
                                        if (BIDSHelperPackage.Plugins[DeployMdxScriptPlugin.BaseName + typeof(DeployMdxScriptPlugin).Name].Enabled)
                                        {
                                            newDeployMdxScriptButton             = new ToolBarButton();
                                            newDeployMdxScriptButton.ToolTipText = "Deploy MDX Script (BIDS Helper)";
                                            newDeployMdxScriptButton.Name        = this.FullName + ".DeployMdxScript";
                                            newDeployMdxScriptButton.Tag         = newDeployMdxScriptButton.Name;
                                            newDeployMdxScriptButton.ImageIndex  = toolbar.ImageList.Images.Count - 1;
                                            newDeployMdxScriptButton.Enabled     = true;
                                            newDeployMdxScriptButton.Style       = ToolBarButtonStyle.PushButton;
                                        }
                                    }

                                    //catch the button clicks of the new buttons we just added
                                    toolbar.ButtonClick += new ToolBarButtonClickEventHandler(toolbar_ButtonClick);

                                    //catch the mouse clicks... the only way to catch the button click for the Microsoft buttons
                                    toolbar.Click += new EventHandler(toolbar_Click);
                                }
                            }
                        }
                        else if (tbb != null && tbb.AssociatedCommandID.ID == 12854 && ScriptViewDefault && !windowHandlesFixedDefaultCalcScriptView.ContainsKey(sHandle))
                        //else if (b.ToolTipText == "Form View" && ScriptViewDefault && !windowHandlesFixedDefaultCalcScriptView.ContainsKey(sHandle)) //12854
                        {
                            Control control = (Control)win.SelectedView.GetType().InvokeMember("ViewControl", getflags, null, win.SelectedView, null);
                            System.Reflection.BindingFlags getfieldflags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.Instance;
                            object controlMgr = control.GetType().InvokeMember("calcControlMgr", getfieldflags, null, control, null);
                            System.Reflection.BindingFlags getmethodflags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.Instance;
                            controlMgr.GetType().InvokeMember("ViewScript", getmethodflags, null, controlMgr, new object[] { });
                            bFlipScriptViewButton = true;
                            b.Pushed = false;
                            windowHandlesFixedDefaultCalcScriptView.Add(sHandle, win);
                        }
                        else if (tbb != null && tbb.AssociatedCommandID.ID == (int)BIDSHelper.BIDSToolbarButtonID.ScriptView && bFlipScriptViewButton)  //12853
                        //else if (b.ToolTipText == "Script View" && bFlipScriptViewButton) //12853
                        {
                            b.Pushed = true;
                        }
                    }
                    if (newDeployMdxScriptButton != null && !toolbar.Buttons.Contains(newDeployMdxScriptButton))
                    {
                        toolbar.Buttons.Insert(iMicrosoftCalcPropertiesIndex, newDeployMdxScriptButton);
                    }
                    if (newCalcPropButton != null && !toolbar.Buttons.Contains(newCalcPropButton))
                    {
                        toolbar.Buttons.Insert(iMicrosoftCalcPropertiesIndex, newCalcPropButton);
                    }
                }
            }
            catch (Exception ex) {
                package.Log.Error("CalcHelpersPlugin Exception: " + ex.Message);
            }
        }
Example #51
0
 public Tool(ToolBarButton button, Icon icon, EventHandler onClick)
 {
     this.button  = button;
     this.icon    = icon;
     this.onClick = onClick;
 }
Example #52
0
        protected override void OnBuildToolBar(Gtk.Toolbar tb)
        {
            base.OnBuildToolBar(tb);

            if (font_label == null)
            {
                font_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Font")));
            }

            tb.AppendItem(font_label);

            if (font_combo == null)
            {
                var fonts = PintaCore.System.Fonts.GetInstalledFonts();
                fonts.Sort();

                // Default to Arial or first in list
                int index = Math.Max(fonts.IndexOf("Arial"), 0);

                font_combo = new ToolBarFontComboBox(150, index, fonts.ToArray());
                font_combo.ComboBox.Changed += HandleFontChanged;
            }

            tb.AppendItem(font_combo);

            if (spacer_label == null)
            {
                spacer_label = new ToolBarLabel(" ");
            }

            tb.AppendItem(spacer_label);

            if (size_combo == null)
            {
                size_combo = new ToolBarComboBox(65, 0, true);

                size_combo.ComboBox.Changed += HandleSizeChanged;
                (size_combo.ComboBox as Gtk.ComboBoxEntry).Entry.FocusOutEvent += new Gtk.FocusOutEventHandler(HandleFontSizeFocusOut);
                (size_combo.ComboBox as Gtk.ComboBoxEntry).Entry.FocusInEvent  += new Gtk.FocusInEventHandler(HandleFontSizeFocusIn);
            }

            tb.AppendItem(size_combo);

            tb.AppendItem(new SeparatorToolItem());

            if (bold_btn == null)
            {
                bold_btn          = new ToolBarToggleButton("Toolbar.Bold.png", Catalog.GetString("Bold"), Catalog.GetString("Bold"));
                bold_btn.Toggled += HandleBoldButtonToggled;
            }

            tb.AppendItem(bold_btn);

            if (italic_btn == null)
            {
                italic_btn          = new ToolBarToggleButton("Toolbar.Italic.png", Catalog.GetString("Italic"), Catalog.GetString("Italic"));
                italic_btn.Toggled += HandleItalicButtonToggled;
            }

            tb.AppendItem(italic_btn);

            if (underscore_btn == null)
            {
                underscore_btn          = new ToolBarToggleButton("Toolbar.Underline.png", Catalog.GetString("Underline"), Catalog.GetString("Underline"));
                underscore_btn.Toggled += HandleUnderscoreButtonToggled;
            }

            tb.AppendItem(underscore_btn);

            tb.AppendItem(new SeparatorToolItem());

            if (left_alignment_btn == null)
            {
                left_alignment_btn          = new ToolBarToggleButton("Toolbar.LeftAlignment.png", Catalog.GetString("Left Align"), Catalog.GetString("Left Align"));
                left_alignment_btn.Active   = true;
                left_alignment_btn.Toggled += HandleLeftAlignmentButtonToggled;
            }

            tb.AppendItem(left_alignment_btn);

            if (center_alignment_btn == null)
            {
                center_alignment_btn          = new ToolBarToggleButton("Toolbar.CenterAlignment.png", Catalog.GetString("Center Align"), Catalog.GetString("Center Align"));
                center_alignment_btn.Toggled += HandleCenterAlignmentButtonToggled;
            }

            tb.AppendItem(center_alignment_btn);

            if (Right_alignment_btn == null)
            {
                Right_alignment_btn          = new ToolBarToggleButton("Toolbar.RightAlignment.png", Catalog.GetString("Right Align"), Catalog.GetString("Right Align"));
                Right_alignment_btn.Toggled += HandleRightAlignmentButtonToggled;
            }

            tb.AppendItem(Right_alignment_btn);

            if (fill_sep == null)
            {
                fill_sep = new Gtk.SeparatorToolItem();
            }

            tb.AppendItem(fill_sep);

            if (fill_label == null)
            {
                fill_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Text Style")));
            }

            tb.AppendItem(fill_label);

            if (fill_button == null)
            {
                fill_button = new ToolBarDropDownButton();

                fill_button.AddItem(Catalog.GetString("Normal"), "ShapeTool.Fill.png", 0);
                fill_button.AddItem(Catalog.GetString("Normal and Outline"), "ShapeTool.OutlineFill.png", 1);
                fill_button.AddItem(Catalog.GetString("Outline"), "ShapeTool.Outline.png", 2);
                fill_button.AddItem(Catalog.GetString("Fill Background"), "TextTool.FillBackground.png", 3);

                fill_button.SelectedItemChanged += HandleBoldButtonToggled;
            }

            tb.AppendItem(fill_button);

            if (outline_width_label == null)
            {
                outline_width_label = new ToolBarLabel(string.Format(" {0}: ", Catalog.GetString("Outline width")));
            }

            tb.AppendItem(outline_width_label);

            if (outline_width_minus == null)
            {
                outline_width_minus          = new ToolBarButton("Toolbar.MinusButton.png", "", Catalog.GetString("Decrease outline size"));
                outline_width_minus.Clicked += MinusButtonClickedEvent;
            }

            tb.AppendItem(outline_width_minus);

            if (outline_width == null)
            {
                outline_width = new ToolBarComboBox(65, 1, true, "1", "2", "3", "4", "5", "6", "7", "8", "9",
                                                    "10", "11", "12", "13", "14", "15", "20", "25", "30", "35",
                                                    "40", "45", "50", "55");

                (outline_width.Child as ComboBoxEntry).Changed += HandleSizeChanged;
            }

            tb.AppendItem(outline_width);

            if (outline_width_plus == null)
            {
                outline_width_plus          = new ToolBarButton("Toolbar.PlusButton.png", "", Catalog.GetString("Increase outline size"));
                outline_width_plus.Clicked += PlusButtonClickedEvent;
            }

            tb.AppendItem(outline_width_plus);

            UpdateFontSizes();

            if (PintaCore.Workspace.HasOpenDocuments)
            {
                //Make sure the event handler is never added twice.
                PintaCore.Workspace.ActiveDocument.LayerCloned -= FinalizeText;

                //When an ImageSurface is Cloned, finalize the re-editable text (if applicable).
                PintaCore.Workspace.ActiveDocument.LayerCloned += FinalizeText;
            }
        }
Example #53
0
 public ToolBarButtonTester(ToolBarButton button, ToolBarTester bar)
 {
     this.bar    = bar;
     this.button = button;
 }
Example #54
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.gv = new SPGridView();
            this.gv.AutoGenerateColumns = false;

            try
            {
                //获取登录用户ID
                UserLoginId = reEmpId(SPContext.Current.Web.CurrentUser.LoginName);

                BindGridView();



                //添加按钮到toolbar
                ToolBar tbarTop = (ToolBar)GetControltByMaster("tbarbusiness");
                //新建
                ToolBarButton tbarbtnAdd = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");
                tbarbtnAdd.ID       = "AddNewRow";
                tbarbtnAdd.Text     = "新建";
                tbarbtnAdd.ImageUrl = "/_layouts/images/newitem.gif";
                tbarbtnAdd.Click   += new EventHandler(tbarbtnAdd_Click);
                tbarTop.Buttons.Controls.Add(tbarbtnAdd);
                //修改
                ToolBarButton tbarbtnEdit = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");
                tbarbtnEdit.ID       = "EditRow";
                tbarbtnEdit.Text     = "修改";
                tbarbtnEdit.ImageUrl = "/_layouts/images/edit.gif";
                tbarbtnEdit.Click   += new EventHandler(tbarbtnEdit_Click);
                tbarTop.Buttons.Controls.Add(tbarbtnEdit);
                //删除

                ToolBarButton tbarbtnDelte = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");
                tbarbtnDelte.ID       = "DeleteRow";
                tbarbtnDelte.Text     = "删除";
                tbarbtnDelte.ImageUrl = "/_layouts/images/delete.gif";
                tbarbtnDelte.Click   += new EventHandler(tbarbtnDelte_Click);
                StringBuilder sbScript = new StringBuilder();
                sbScript.Append("var aa= window.confirm('确认删除所选项?');");
                sbScript.Append("if(aa == false){");
                sbScript.Append("return false;}");
                tbarbtnDelte.OnClientClick = sbScript.ToString();
                tbarTop.Buttons.Controls.Add(tbarbtnDelte);



                ToolBarButton btnRefresh = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");
                btnRefresh.ID       = "btnRefresh";
                btnRefresh.Text     = "刷新";
                btnRefresh.ImageUrl = "/_layouts/images/refresh.GIF";
                btnRefresh.Padding  = "0,5,0,0";
                btnRefresh.Click   += new EventHandler(btnRefresh_Click);
                tbarTop.RightButtons.Controls.Add(btnRefresh);
            }

            catch (Exception ex)
            {
                MethodBase    mb      = MethodBase.GetCurrentMethod();
                LogToDBHelper lhelper = LogToDBHelper.Instance; lhelper.WriteLog(ex.Message, "错误", string.Format("{0}.{1}", mb.ReflectedType.Name, mb.Name));
                ClientScript.RegisterClientScriptBlock(typeof(string), "提示", string.Format("<script>alert('{0}')</script>", LogToDBHelper.LOG_MSG_LOADERROR));
            }
        }
        public static ToolBarButton CreateGroupContainer(EntityOperationGroup group)
        {
            ToolBarButton groupButton = new ToolBarButton
            {
                Content = group.Description(),
                ContextMenu = new ContextMenu(),
                Background = group.Background,
            };

            Common.SetOrder(groupButton, group.Order);

            AutomationProperties.SetItemStatus(groupButton, "Group");

            if (group.AutomationName.HasText())
                AutomationProperties.SetName(groupButton, group.AutomationName);

            groupButton.ContextMenu = new ContextMenu
            {
                PlacementTarget = groupButton,
                Placement = PlacementMode.Bottom,
            };

            ContextMenuService.SetIsEnabled(groupButton, false);

            groupButton.Click += (object sender, RoutedEventArgs e) =>
            {
                ToolBarButton tbb = (ToolBarButton)sender;
                tbb.ContextMenu.IsEnabled = true;
                tbb.ContextMenu.IsOpen = true;
            };

            return groupButton;
        }
Example #56
0
        private void SetToolbar()
        {
            ToolBarButton sep = new ToolBarButton();

            sep.Style = ToolBarButtonStyle.Separator;

            #region cmdButtons   - Buttons [0~3]
            toolBar.Buttons.Add(new ToolBarButton("Columns", string.Empty));
            toolBar.Buttons[0].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-view-column-outline.png");
            toolBar.Buttons[0].ToolTipText = (@"Hide/Unhide Columns");
            toolBar.Buttons.Add(new ToolBarButton("Sorting", String.Empty));
            toolBar.Buttons[1].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-sort-ascending.png");
            toolBar.Buttons[1].ToolTipText = (@"Sorting");
            toolBar.Buttons.Add(new ToolBarButton("Checkbox", String.Empty));
            toolBar.Buttons[2].Image       = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-check-box-outline.png");
            toolBar.Buttons[2].ToolTipText = (@"Toggle Checkbox");
            toolBar.Buttons.Add(new ToolBarButton("MultiSelect", String.Empty));
            toolBar.Buttons[3].Image       = new IconResourceHandle(GlobalVars.Theme + ".16.listview_multiselect.gif");
            toolBar.Buttons[3].ToolTipText = (@"Toggle Multi-Select");
            toolBar.Buttons[3].Visible     = false;
            #endregion

            toolBar.Buttons.Add(sep);

            #region cmdViews    - Buttons[5]
            ContextMenu ddlViews = new ContextMenu();
            ToolbarHelper.AppendMenuItem_AppViews(ref ddlViews);
            ToolBarButton cmdViews = new ToolBarButton("Views", ("View"));
            cmdViews.Style        = ToolBarButtonStyle.DropDownButton;
            cmdViews.Image        = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-eye.png");
            cmdViews.DropDownMenu = ddlViews;
            toolBar.Buttons.Add(cmdViews);
            cmdViews.MenuClick += new MenuEventHandler(toolBar_Views_MenuClick);
            #endregion

            #region cmdPreference    - Buttons[6]
            ContextMenu ddlPreference = new ContextMenu();
            ToolbarHelper.AppendMenuItem_AppPref(ref ddlPreference);

            ToolBarButton cmdPreference = new ToolBarButton("Preference", ("Preference"));
            cmdPreference.Style        = ToolBarButtonStyle.DropDownButton;
            cmdPreference.Image        = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-table-heart.png");
            cmdPreference.DropDownMenu = ddlPreference;
            cmdPreference.MenuClick   += new MenuEventHandler(toolBar_Preference_MenuClick);

            toolBar.Buttons.Add(cmdPreference);
            #endregion

            toolBar.Buttons.Add(sep);

            #region cmdRefresh cmdEditRole
            var cmdRefresh = new ToolBarButton("Refresh", ("Refresh"));
            cmdRefresh.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-reload.png");

            toolBar.Buttons.Add(cmdRefresh);

            toolBar.Buttons.Add(sep);

            ToolBarButton cmdManageAuth = new ToolBarButton("ManageAuthorization", ("Manage Authorization"));
            cmdManageAuth.Image = new IconResourceHandle(GlobalVars.Theme + ".24.mdi-shield-account.png");
            //cmdManageAuth.Enabled = false;

            toolBar.Buttons.Add(cmdManageAuth);
            #endregion

            toolBar.TextAlign    = ToolBarTextAlign.Right;
            toolBar.ButtonClick += toolBar_ButtonClick;
        }
Example #57
0
	private FormsHello()
	{
		// Force the entire form to repaint when it is resized.
		SetStyle(ControlStyles.ResizeRedraw, true);

		// Set some initial form properties.
		Size = new Size(400, 270);
		Text = "Forms Hello";

		// Create a button control on the form.
		button = new Button();
		button.Text = "Click Me!";
		button.Location = new Point(30, 130);
		Controls.Add(button);
		
		// Create a progress bar control
		progress = new ProgressBar();
		progress.Location = new Point(30, 175);
		progress.Anchor = AnchorStyles.Top |
						  AnchorStyles.Left |
						  AnchorStyles.Right;
		Controls.Add(progress);

		// Create a label and dock it to the bottom.
		Label label = new Label();
		label.Text = "This is a label, docked to the bottom ...";
		label.BackColor = Color.White;
		label.Dock = DockStyle.Bottom;
		Controls.Add(label);

		// Hook up interesting events.
		Paint += new PaintEventHandler(HandlePaint);
		button.Click += new EventHandler(HandleClick);

		// Create a scrollbar control.
		scrollbar = new HScrollBar();
		scrollbar.Dock = DockStyle.Bottom;
		Controls.Add(scrollbar);
		scrollbar = new VScrollBar();
		scrollbar.Dock = DockStyle.Right;
		Controls.Add(scrollbar);

		// Create a toolbar control and some toolbar buttons.
		toolbar = new ToolBar();
		toolbar.Buttons.Add("Hello");
		ToolBarButton tbb = new ToolBarButton();
		tbb.Style = ToolBarButtonStyle.Separator;
		toolbar.Buttons.Add(tbb);
		tbb = new ToolBarButton("World!");
		toolbar.Buttons.Add(tbb);
		toolbar.Appearance = ToolBarAppearance.Flat;
		toolbar.BorderStyle = BorderStyle.FixedSingle;
		Controls.Add(toolbar);

		// Create another toolbar.
		// This reveals some layout bugs, so
		// the Controls.Add is commented out
		// to keep the sample looking good
		toolbar = new ToolBar();
		toolbar.Buttons.Add("This one's");
		tbb = new ToolBarButton();
		tbb.Style = ToolBarButtonStyle.Separator;
		toolbar.Buttons.Add(tbb);
		tbb = new ToolBarButton("left docked.");
		tbb.Style = ToolBarButtonStyle.DropDownButton;
		toolbar.Buttons.Add(tbb);
		toolbar.BorderStyle = BorderStyle.Fixed3D;
		toolbar.Dock = DockStyle.Left;
		//toolbar.DropDownArrows = false;
		//Controls.Add(toolbar);

		checkbox=new CheckBox();
		checkbox.Location=new Point(70,95);
		checkbox.Text="Any Good ?";
		checkbox.Checked=true;
		checkbox.CheckStateChanged += new EventHandler(HandleCheck);
		Controls.Add(checkbox);
	}
        /// <summary>
        /// 初始化toolbar
        /// </summary>
        private void InitToolBar(bool bo)
        {
            //添加按钮到toolbar
            ToolBar tbarTop = (ToolBar)GetControltByMaster("tbarbusiness");

            //新建
            ToolBarButton tbarbtnAdd = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarbtnAdd.ID       = "AddNewRow";
            tbarbtnAdd.Text     = "新建";
            tbarbtnAdd.ImageUrl = "/_layouts/images/newitem.gif";
            tbarbtnAdd.Click   += new EventHandler(tbarbtnAdd_Click);

            //修改
            //ToolBarButton tbarbtnEdit = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");
            //tbarbtnEdit.ID = "EditRow";
            //tbarbtnEdit.Text = "修改";
            //tbarbtnEdit.ImageUrl = "/_layouts/images/edit.gif";
            //tbarbtnEdit.Click += new EventHandler(tbarbtnEdit_Click);
            //tbarTop.Buttons.Controls.Add(tbarbtnEdit);
            //删除


            ToolBarButton tbarbtnDelte = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarbtnDelte.ID       = "DeleteRow";
            tbarbtnDelte.Text     = "删除";
            tbarbtnDelte.ImageUrl = "/_layouts/images/delete.gif";
            tbarbtnDelte.Click   += new EventHandler(tbarbtnDelte_Click);
            StringBuilder sbScript = new StringBuilder();

            sbScript.Append("var aa= window.confirm('确认删除所选项?');");
            sbScript.Append("if(aa == false){");
            sbScript.Append("return false;}");
            tbarbtnDelte.OnClientClick = sbScript.ToString();


            //返回
            ToolBarButton tbarbtnBack = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarbtnBack.ID       = "backRow";
            tbarbtnBack.Text     = "确认并返回";
            tbarbtnBack.ImageUrl = "/_layouts/images/BACK.GIF";
            tbarbtnBack.Click   += new EventHandler(tbarbtnBack_Click);

            //返回
            ToolBarButton tbarBack = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarBack.ID       = "backRow";
            tbarBack.Text     = "返回";
            tbarBack.ImageUrl = "/_layouts/images/BACK.GIF";
            tbarBack.Click   += new EventHandler(tbarBack_Click);

            ToolBarButton btnRefresh = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            btnRefresh.ID       = "btnRefresh";
            btnRefresh.Text     = "刷新";
            btnRefresh.ImageUrl = "/_layouts/images/refresh.GIF";
            btnRefresh.Padding  = "0,5,0,0";
            btnRefresh.Click   += new EventHandler(btnRefresh_Click);
            tbarTop.RightButtons.Controls.Add(btnRefresh);
            if (bo)
            {
                tbarTop.Buttons.Controls.Add(tbarbtnAdd);
                tbarTop.Buttons.Controls.Add(tbarbtnDelte);
                if (!((Panel)GetControltByMaster("PanelDone")).Visible)
                {
                    tbarTop.Buttons.Controls.Add(tbarbtnBack);
                }
            }
            else
            {
                tbarTop.Buttons.Controls.Add(tbarBack);
                ((Label)GetControltByMaster("intask")).Visible = true;
            }
            //   tbarTop.Visible = bo;
        }
Example #59
0
	public MainForm ()
	{
		// 
		// _toolBar
		// 
		_toolBar = new ToolBar ();
		_toolBar.DropDownArrows = true;
		_toolBar.Dock = DockStyle.Top;
		_toolBar.ShowToolTips = true;
		_toolBar.TabIndex = 1;
		Controls.Add (_toolBar);
		// 
		// _toolBarButton1
		// 
		_toolBarButton1 = new ToolBarButton ();
		_toolBar.Buttons.Add (_toolBarButton1);
		// 
		// _toolBarButton2
		// 
		_toolBarButton2 = new ToolBarButton ();
		_toolBar.Buttons.Add (_toolBarButton2);
		// 
		// _toolBarButton3
		// 
		_toolBarButton3 = new ToolBarButton ();
		_toolBar.Buttons.Add (_toolBarButton3);
		// 
		// _styleGroupBox
		// 
		_styleGroupBox = new GroupBox ();
		_styleGroupBox.Location = new Point (8, 30);
		_styleGroupBox.Size = new Size (270, 65);
		_styleGroupBox.Text = "Style";
		Controls.Add (_styleGroupBox);
		// 
		// _dropDownButtonStyleRadioButton
		// 
		_dropDownButtonStyleRadioButton = new RadioButton ();
		_dropDownButtonStyleRadioButton.Checked = (_toolBarButton2.Style == ToolBarButtonStyle.DropDownButton);
		_dropDownButtonStyleRadioButton.Location = new Point (8, 15);
		_dropDownButtonStyleRadioButton.Text = "DropDownButton";
		_dropDownButtonStyleRadioButton.Width = 120;
		_dropDownButtonStyleRadioButton.CheckedChanged += new EventHandler (DropDownButtonStyleRadioButton_CheckedChanged);
		_styleGroupBox.Controls.Add (_dropDownButtonStyleRadioButton);
		// 
		// _pushButtonStyleRadioButton
		// 
		_pushButtonStyleRadioButton = new RadioButton ();
		_pushButtonStyleRadioButton.Checked = (_toolBarButton2.Style == ToolBarButtonStyle.PushButton);
		_pushButtonStyleRadioButton.Location = new Point (8, 35);
		_pushButtonStyleRadioButton.Text = "PushButton";
		_pushButtonStyleRadioButton.CheckedChanged += new EventHandler (PushButtonStyleRadioButton_CheckedChanged);
		_styleGroupBox.Controls.Add (_pushButtonStyleRadioButton);
		// 
		// _separatorStyleRadioButton
		// 
		_separatorStyleRadioButton = new RadioButton ();
		_separatorStyleRadioButton.Checked = (_toolBarButton2.Style == ToolBarButtonStyle.Separator);
		_separatorStyleRadioButton.Location = new Point (150, 15);
		_separatorStyleRadioButton.Text = "Separator";
		_separatorStyleRadioButton.CheckedChanged += new EventHandler (SeparatorStyleRadioButton_CheckedChanged);
		_styleGroupBox.Controls.Add (_separatorStyleRadioButton);
		// 
		// _toggleButtonStyleRadioButton
		// 
		_toggleButtonStyleRadioButton = new RadioButton ();
		_toggleButtonStyleRadioButton.Checked = (_toolBarButton2.Style == ToolBarButtonStyle.ToggleButton);
		_toggleButtonStyleRadioButton.Location = new Point (150, 35);
		_toggleButtonStyleRadioButton.Text = "ToggleButton";
		_toggleButtonStyleRadioButton.CheckedChanged += new EventHandler (ToggleButtonStyleRadioButton_CheckedChanged);
		_styleGroupBox.Controls.Add (_toggleButtonStyleRadioButton);
		// 
		// MainForm
		// 
		ClientSize = new Size (285, 105);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81523";
		Load += new EventHandler (MainForm_Load);
	}
Example #60
0
        private void SetToolBar()
        {
            this.tbWizardAction.MenuHandle = false;
            this.tbWizardAction.DragHandle = false;
            this.tbWizardAction.TextAlign  = ToolBarTextAlign.Right;

            ToolBarButton sep = new ToolBarButton();

            sep.Style = ToolBarButtonStyle.Separator;

            // cmdSave
            ToolBarButton cmdSave = new ToolBarButton("Save", Utility.Dictionary.GetWord("Save"));

            cmdSave.Tag     = "Save";
            cmdSave.Image   = new IconResourceHandle("16x16.16_L_save.gif");
            cmdSave.Enabled = RT2020.Controls.UserUtility.IsAccessAllowed(EnumHelper.Permission.Write);

            this.tbWizardAction.Buttons.Add(cmdSave);

            // cmdSaveNew
            ToolBarButton cmdSaveNew = new ToolBarButton("Save & New", HttpUtility.UrlDecode(Utility.Dictionary.GetWord("Save_New")));

            cmdSaveNew.Tag     = "Save & New";
            cmdSaveNew.Image   = new IconResourceHandle("16x16.16_L_saveOpen.gif");
            cmdSaveNew.Enabled = false;

            this.tbWizardAction.Buttons.Add(cmdSaveNew);

            // cmdSaveClose
            ToolBarButton cmdSaveClose = new ToolBarButton("Save & Close", HttpUtility.UrlDecode(Utility.Dictionary.GetWord("Save_Close")));

            cmdSaveClose.Tag     = "Save & Close";
            cmdSaveClose.Image   = new IconResourceHandle("16x16.16_saveClose.gif");
            cmdSaveClose.Enabled = RT2020.Controls.UserUtility.IsAccessAllowed(EnumHelper.Permission.Write);

            this.tbWizardAction.Buttons.Add(cmdSaveClose);
            this.tbWizardAction.Buttons.Add(sep);

            // cmdDelete
            ToolBarButton cmdDelete = new ToolBarButton("Delete", Utility.Dictionary.GetWord("Delete"));

            cmdDelete.Tag   = "Delete";
            cmdDelete.Image = new IconResourceHandle("16x16.16_L_remove.gif");

            // cmdPrint
            ToolBarButton cmdPrint = new ToolBarButton("Print", Utility.Dictionary.GetWord("Print"));

            cmdPrint.Tag   = "Print";
            cmdPrint.Image = new IconResourceHandle("16x16.16_print.gif");

            if (RplId == System.Guid.Empty)
            {
                cmdDelete.Enabled = false;
                cmdPrint.Enabled  = false;
            }
            else
            {
                cmdDelete.Enabled = RT2020.Controls.UserUtility.IsAccessAllowed(EnumHelper.Permission.Delete);
                cmdPrint.Enabled  = RT2020.Controls.UserUtility.IsAccessAllowed(EnumHelper.Permission.Write);
            }

            this.tbWizardAction.Buttons.Add(cmdDelete);
            this.tbWizardAction.Buttons.Add(sep);
            this.tbWizardAction.Buttons.Add(cmdPrint);

            this.tbWizardAction.ButtonClick += new ToolBarButtonClickEventHandler(tbWizardAction_ButtonClick);
        }