Esempio n. 1
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);
	}
Esempio n. 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();
    }
Esempio n. 3
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";
	}
        protected virtual ToolBarButton AddToolbarButton(ToolBar parent, string title, string ID)
        {
            ToolBarButton btn = (ToolBarButton)Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");
            parent.Buttons.Controls.Add(btn);

            btn.Text = title;
            btn.ID = ID;
            btn.OnClientClick = "g_bWarnBeforeLeave = false";

            return btn;
        }
Esempio n. 5
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);
	}
Esempio n. 6
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;
*/
	}
Esempio n. 7
0
        private void tooBarTop_ItemClicked(object sender, ToolBar.ToolBarItemClickArgs e)
        {
            
            switch (e.Key)
            {
                case "Save" :
                    this.editForm.Save();
                    break;
                case "CheckBudget" :
                    CheckBudget();
                    break;

            }
            
        }
Esempio n. 8
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();
    }
Esempio n. 10
0
    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();
    }
Esempio n. 11
0
    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();
    }
Esempio n. 12
0
    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]);
        }
    }
Esempio n. 13
0
        public MainForm()
        {
            Title      = "My Eto Form";
            ClientSize = new Size(400, 350);
            var gv = new GridView();

            gv.Columns.Add(new GridColumn()
            {
                HeaderText = "Creator", DataCell = new TextBoxCell("CreatorName")
            });
            var ds = new NoteRepo();

            gv.DataStore = ds.GetAll();
            var layout = new TableLayout();

            layout.Rows.Add(new TableRow(new TableCell(new Scrollable()
            {
                Content = gv
            })));

            layout.Rows.Add(new TableRow(new TableCell(new Panel())));
            // scrollable region as the main content
            Content = layout;

            // create a few commands that can be used for the menu and toolbar
            var clickMe = new Command {
                MenuText = "Click Me!", ToolBarText = "Click Me!"
            };

            clickMe.Executed += (sender, e) => MessageBox.Show(this, "I was clicked!");

            var quitCommand = new Command {
                MenuText = "Quit", Shortcut = Application.Instance.CommonModifier | Keys.Q
            };

            quitCommand.Executed += (sender, e) => Application.Instance.Quit();

            var aboutCommand = new Command {
                MenuText = "About..."
            };

            aboutCommand.Executed += (sender, e) => MessageBox.Show(this, "About my app...");

            // create menu
            Menu = new MenuBar
            {
                Items =
                {
                    // File submenu
                    new ButtonMenuItem {
                        Text = "&File", Items ={ clickMe          }
                    },
                    // new ButtonMenuItem { Text = "&Edit", Items = { /* commands/items */ } },
                    // new ButtonMenuItem { Text = "&View", Items = { /* commands/items */ } },
                },
                ApplicationItems =
                {
                    // application (OS X) or file menu (others)
                    new ButtonMenuItem {
                        Text = "&Preferences..."
                    },
                },
                QuitItem  = quitCommand,
                AboutItem = aboutCommand
            };

            // create toolbar
            ToolBar = new ToolBar {
                Items = { clickMe }
            };
        }
Esempio n. 14
0
        private void InitializeComponent()
        {
            this.components = new Container();
            ResourceManager manager = new ResourceManager(typeof(frmGeneracionAsignacion));

            this.tbLecturas       = new ToolBar();
            this.tbConsultar      = new ToolBarButton();
            this.tbGenerar        = new ToolBarButton();
            this.tbEspecial       = new ToolBarButton();
            this.tbArchivo        = new ToolBarButton();
            this.tbSeguimiento    = new ToolBarButton();
            this.tbCerrar         = new ToolBarButton();
            this.imgListGenerar   = new ImageList(this.components);
            this.statusBar        = new StatusBar();
            this.statusBarPanel1  = new StatusBarPanel();
            this.lblClientesHijo  = new Label();
            this.vwgClientesHijo  = new vwGrd();
            this.lblLecturistas   = new Label();
            this.vwgLecturistas   = new vwGrd();
            this.lblClientesPadre = new Label();
            this.vwgClientesPadre = new vwGrd();
            this.label4           = new Label();
            this.dtpFechaVisita   = new DateTimePicker();
            this.saveFileDialog1  = new SaveFileDialog();
            this.btnValidar       = new Button();
            this.statusBarPanel1.BeginInit();
            base.SuspendLayout();
            this.tbLecturas.Appearance = ToolBarAppearance.Flat;
            this.tbLecturas.Buttons.AddRange(new ToolBarButton[] { this.tbConsultar, this.tbGenerar, this.tbEspecial, this.tbArchivo, this.tbSeguimiento, this.tbCerrar });
            this.tbLecturas.DropDownArrows = true;
            this.tbLecturas.ImageList      = this.imgListGenerar;
            this.tbLecturas.Name           = "tbLecturas";
            this.tbLecturas.ShowToolTips   = true;
            this.tbLecturas.Size           = new Size(0x318, 0x27);
            this.tbLecturas.TabIndex       = 0;
            this.tbLecturas.ButtonClick   += new ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
            this.tbConsultar.ImageIndex    = 2;
            this.tbConsultar.Tag           = "Consultar";
            this.tbConsultar.Text          = "&Consultar";
            this.tbGenerar.Enabled         = false;
            this.tbGenerar.ImageIndex      = 0;
            this.tbGenerar.Tag             = "Generar";
            this.tbGenerar.Text            = "&Generar";
            this.tbEspecial.ImageIndex     = 3;
            this.tbEspecial.Tag            = "Especial";
            this.tbEspecial.Text           = "&Especial";
            this.tbArchivo.ImageIndex      = 1;
            this.tbArchivo.Tag             = "Exportar";
            this.tbArchivo.Text            = "&Exportar";
            this.tbSeguimiento.ImageIndex  = 4;
            this.tbSeguimiento.Tag         = "Seguimiento";
            this.tbSeguimiento.Text        = "&Seguimiento";
            this.tbCerrar.ImageIndex       = 5;
            this.tbCerrar.Tag                    = "Cerrar";
            this.tbCerrar.Text                   = "&Cerrar";
            this.imgListGenerar.ColorDepth       = ColorDepth.Depth8Bit;
            this.imgListGenerar.ImageSize        = new Size(0x10, 0x10);
            this.imgListGenerar.ImageStream      = (ImageListStreamer)manager.GetObject("imgListGenerar.ImageStream");
            this.imgListGenerar.TransparentColor = Color.Transparent;
            this.statusBar.Location              = new Point(0, 0x227);
            this.statusBar.Name                  = "statusBar";
            this.statusBar.Panels.AddRange(new StatusBarPanel[] { this.statusBarPanel1 });
            this.statusBar.ShowPanels                   = true;
            this.statusBar.Size                         = new Size(0x318, 0x16);
            this.statusBar.TabIndex                     = 1;
            this.statusBarPanel1.Width                  = 500;
            this.lblClientesHijo.Anchor                 = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.lblClientesHijo.BorderStyle            = BorderStyle.Fixed3D;
            this.lblClientesHijo.Location               = new Point(0x148, 40);
            this.lblClientesHijo.Name                   = "lblClientesHijo";
            this.lblClientesHijo.Size                   = new Size(0x1d0, 0x17);
            this.lblClientesHijo.TabIndex               = 2;
            this.lblClientesHijo.Text                   = "Contratos hijo";
            this.lblClientesHijo.TextAlign              = ContentAlignment.MiddleLeft;
            this.vwgClientesHijo.Anchor                 = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.vwgClientesHijo.ColumnMargin           = 1;
            this.vwgClientesHijo.FullRowSelect          = true;
            this.vwgClientesHijo.HideSelection          = false;
            this.vwgClientesHijo.Location               = new Point(0x148, 0x40);
            this.vwgClientesHijo.MultiSelect            = false;
            this.vwgClientesHijo.Name                   = "vwgClientesHijo";
            this.vwgClientesHijo.Size                   = new Size(0x1d0, 0x1e4);
            this.vwgClientesHijo.TabIndex               = 3;
            this.vwgClientesHijo.View                   = View.Details;
            this.vwgClientesHijo.DoubleClick           += new EventHandler(this.vwgClientesHijo_DoubleClick);
            this.lblLecturistas.BorderStyle             = BorderStyle.Fixed3D;
            this.lblLecturistas.Location                = new Point(0, 40);
            this.lblLecturistas.Name                    = "lblLecturistas";
            this.lblLecturistas.Size                    = new Size(0x148, 0x17);
            this.lblLecturistas.TabIndex                = 4;
            this.lblLecturistas.Text                    = "Lecturistas y zonas";
            this.lblLecturistas.TextAlign               = ContentAlignment.MiddleLeft;
            this.vwgLecturistas.ColumnMargin            = 1;
            this.vwgLecturistas.FullRowSelect           = true;
            this.vwgLecturistas.HideSelection           = false;
            this.vwgLecturistas.Location                = new Point(0, 0x40);
            this.vwgLecturistas.MultiSelect             = false;
            this.vwgLecturistas.Name                    = "vwgLecturistas";
            this.vwgLecturistas.Size                    = new Size(0x148, 0xc4);
            this.vwgLecturistas.TabIndex                = 5;
            this.vwgLecturistas.View                    = View.Details;
            this.vwgLecturistas.SelectedIndexChanged   += new EventHandler(this.vwgLecturistas_SelectedIndexChanged);
            this.lblClientesPadre.BorderStyle           = BorderStyle.Fixed3D;
            this.lblClientesPadre.Location              = new Point(0, 0x105);
            this.lblClientesPadre.Name                  = "lblClientesPadre";
            this.lblClientesPadre.Size                  = new Size(0x148, 0x17);
            this.lblClientesPadre.TabIndex              = 6;
            this.lblClientesPadre.Text                  = "Contratos padre";
            this.lblClientesPadre.TextAlign             = ContentAlignment.MiddleLeft;
            this.vwgClientesPadre.Anchor                = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.vwgClientesPadre.ColumnMargin          = 1;
            this.vwgClientesPadre.FullRowSelect         = true;
            this.vwgClientesPadre.HideSelection         = false;
            this.vwgClientesPadre.Location              = new Point(0, 0x11d);
            this.vwgClientesPadre.MultiSelect           = false;
            this.vwgClientesPadre.Name                  = "vwgClientesPadre";
            this.vwgClientesPadre.Size                  = new Size(0x148, 0x107);
            this.vwgClientesPadre.TabIndex              = 7;
            this.vwgClientesPadre.View                  = View.Details;
            this.vwgClientesPadre.SelectedIndexChanged += new EventHandler(this.vwgClientesPadre_SelectedIndexChanged);
            this.label4.Anchor                = AnchorStyles.Right | AnchorStyles.Top;
            this.label4.AutoSize              = true;
            this.label4.Location              = new Point(0x240, 12);
            this.label4.Name                  = "label4";
            this.label4.Size                  = new Size(0x52, 14);
            this.label4.TabIndex              = 8;
            this.label4.Text                  = "Fecha de visita:";
            this.dtpFechaVisita.Anchor        = AnchorStyles.Right | AnchorStyles.Top;
            this.dtpFechaVisita.Format        = DateTimePickerFormat.Short;
            this.dtpFechaVisita.Location      = new Point(0x2a0, 9);
            this.dtpFechaVisita.Name          = "dtpFechaVisita";
            this.dtpFechaVisita.Size          = new Size(0x54, 0x15);
            this.dtpFechaVisita.TabIndex      = 9;
            this.dtpFechaVisita.ValueChanged += new EventHandler(this.dtpFechaVisita_ValueChanged);
            this.saveFileDialog1.FileName     = "doc1";
            this.btnValidar.Anchor            = AnchorStyles.Right | AnchorStyles.Top;
            this.btnValidar.FlatStyle         = FlatStyle.Popup;
            this.btnValidar.Image             = (Bitmap)manager.GetObject("btnValidar.Image");
            this.btnValidar.Location          = new Point(760, 8);
            this.btnValidar.Name              = "btnValidar";
            this.btnValidar.Size              = new Size(0x18, 0x18);
            this.btnValidar.TabIndex          = 11;
            this.btnValidar.Click            += new EventHandler(this.btnValidar_Click);
            this.AutoScaleBaseSize            = new Size(5, 14);
            base.ClientSize = new Size(0x318, 0x23d);
            base.Controls.AddRange(new Control[] { this.btnValidar, this.dtpFechaVisita, this.label4, this.vwgClientesPadre, this.vwgLecturistas, this.vwgClientesHijo, this.lblClientesPadre, this.lblLecturistas, this.lblClientesHijo, this.statusBar, this.tbLecturas });
            this.Font          = new Font("Tahoma", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            base.Icon          = (Icon)manager.GetObject("$this.Icon");
            base.Name          = "frmGeneracionAsignacion";
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text          = "Generaci\x00f3n de asignacion de lecturas";
            base.Load         += new EventHandler(this.frmGeneracionAsignacion_Load);
            this.statusBarPanel1.EndInit();
            base.ResumeLayout(false);
        }
Esempio n. 15
0
        void tooBarTop_ItemClicked(object sender, ToolBar.ToolBarItemClickArgs e)
        {
            switch (e.Key)
            {
                case "AddType" :
                    AddType();
                    break;
                case "AddSubject":
                    AddSubject();
                    break;
                case "AddSubSubject":
                    AddSubSubject();
                    break;
                case "Save":
                    try
                    {
                        ShowProcess();
                        bool isCheck = Save();

                        if ( !isCheck)
                        {
                            CloseProcess();
                        }
                    }
                    catch ( Exception ex)
                    {
                        CommonFunction.ShowErrorMessage(ex.Message);
                        CloseProcess();
                    }
                    break;
                case "Delete":
                    Delete();
                    break;
            }

        }
Esempio n. 16
0
 static internal void Drawer_ToolBarButton(
     ToolBar button, Editor owner,
     params GUILayoutOption[] options
     )
 => HDEditorUtils.DrawToolBarButton(button, owner, k_ToolbarMode, k_ToolbarContents, options);
Esempio n. 17
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.myToolbar                           = new System.Windows.Forms.ToolBar();
     this.myToolbarButton                     = new System.Windows.Forms.ToolBarButton();
     this.contextMenuStrip1                   = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.jobGuideToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.berufszentrumToolStripMenuItem      = new System.Windows.Forms.ToolStripMenuItem();
     this.karrieredeToolStripMenuItem         = new System.Windows.Forms.ToolStripMenuItem();
     this.berufeNetToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
     this.gehaltsCheckToolStripMenuItem       = new System.Windows.Forms.ToolStripMenuItem();
     this.versicherungToolStripMenuItem       = new System.Windows.Forms.ToolStripMenuItem();
     this.CareerToolStripMenuItem             = new System.Windows.Forms.ToolStripMenuItem();
     this.contextMenuStrip2                   = new System.Windows.Forms.ContextMenuStrip(this.components);
     this.jobBlogMittelstandToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.arbeitsmarktToolStripMenuItem       = new System.Windows.Forms.ToolStripMenuItem();
     this.mittelstandJobsToolStripMenuItem    = new System.Windows.Forms.ToolStripMenuItem();
     this.comboSearchBox                      = new System.Windows.Forms.ComboBox();
     this.panel1              = new System.Windows.Forms.Panel();
     this.button1             = new System.Windows.Forms.Button();
     this.searchBox           = new System.Windows.Forms.RichTextBox();
     this.btnRssFeed          = new System.Windows.Forms.Button();
     this.btnCareer           = new System.Windows.Forms.Button();
     this.lblMiddleDividerBar = new System.Windows.Forms.Label();
     this.lblmainLogo         = new System.Windows.Forms.Label();
     this.dottedBar           = new System.Windows.Forms.Label();
     this.btnGO = new System.Windows.Forms.Button();
     this.contextMenuStrip1.SuspendLayout();
     this.contextMenuStrip2.SuspendLayout();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // myToolbar
     //
     this.myToolbar.DropDownArrows = true;
     this.myToolbar.Location       = new System.Drawing.Point(0, 0);
     this.myToolbar.Name           = "myToolbar";
     this.myToolbar.ShowToolTips   = true;
     this.myToolbar.Size           = new System.Drawing.Size(100, 42);
     this.myToolbar.TabIndex       = 0;
     //
     // myToolbarButton
     //
     this.myToolbarButton.Name = "myToolbarButton";
     //
     // contextMenuStrip1
     //
     this.contextMenuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.jobGuideToolStripMenuItem,
         this.berufszentrumToolStripMenuItem,
         this.karrieredeToolStripMenuItem,
         this.berufeNetToolStripMenuItem,
         this.gehaltsCheckToolStripMenuItem,
         this.versicherungToolStripMenuItem
     });
     this.contextMenuStrip1.Name             = "contextMenuStrip1";
     this.contextMenuStrip1.RenderMode       = System.Windows.Forms.ToolStripRenderMode.Professional;
     this.contextMenuStrip1.ShowImageMargin  = false;
     this.contextMenuStrip1.ShowItemToolTips = false;
     this.contextMenuStrip1.Size             = new System.Drawing.Size(131, 136);
     //
     // jobGuideToolStripMenuItem
     //
     this.jobGuideToolStripMenuItem.Name   = "jobGuideToolStripMenuItem";
     this.jobGuideToolStripMenuItem.Size   = new System.Drawing.Size(130, 22);
     this.jobGuideToolStripMenuItem.Text   = "JobGuide";
     this.jobGuideToolStripMenuItem.Click += new System.EventHandler(this.jobGuideToolStripMenuItem_Click);
     //
     // berufszentrumToolStripMenuItem
     //
     this.berufszentrumToolStripMenuItem.Name   = "berufszentrumToolStripMenuItem";
     this.berufszentrumToolStripMenuItem.Size   = new System.Drawing.Size(130, 22);
     this.berufszentrumToolStripMenuItem.Text   = "Berufszentrum";
     this.berufszentrumToolStripMenuItem.Click += new System.EventHandler(this.berufszentrumToolStripMenuItem_Click);
     //
     // karrieredeToolStripMenuItem
     //
     this.karrieredeToolStripMenuItem.Name   = "karrieredeToolStripMenuItem";
     this.karrieredeToolStripMenuItem.Size   = new System.Drawing.Size(130, 22);
     this.karrieredeToolStripMenuItem.Text   = "Karriere.de";
     this.karrieredeToolStripMenuItem.Click += new System.EventHandler(this.karrieredeToolStripMenuItem_Click);
     //
     // berufeNetToolStripMenuItem
     //
     this.berufeNetToolStripMenuItem.Name   = "berufeNetToolStripMenuItem";
     this.berufeNetToolStripMenuItem.Size   = new System.Drawing.Size(130, 22);
     this.berufeNetToolStripMenuItem.Text   = "BerufeNet";
     this.berufeNetToolStripMenuItem.Click += new System.EventHandler(this.berufeNetToolStripMenuItem_Click);
     //
     // gehaltsCheckToolStripMenuItem
     //
     this.gehaltsCheckToolStripMenuItem.Name   = "gehaltsCheckToolStripMenuItem";
     this.gehaltsCheckToolStripMenuItem.Size   = new System.Drawing.Size(130, 22);
     this.gehaltsCheckToolStripMenuItem.Text   = "GehaltsCheck";
     this.gehaltsCheckToolStripMenuItem.Click += new System.EventHandler(this.gehaltsCheckToolStripMenuItem_Click);
     //
     // versicherungToolStripMenuItem
     //
     this.versicherungToolStripMenuItem.Name   = "versicherungToolStripMenuItem";
     this.versicherungToolStripMenuItem.Size   = new System.Drawing.Size(130, 22);
     this.versicherungToolStripMenuItem.Text   = "Versicherung";
     this.versicherungToolStripMenuItem.Click += new System.EventHandler(this.versicherungToolStripMenuItem_Click);
     //
     // CareerToolStripMenuItem
     //
     this.CareerToolStripMenuItem.AccessibleRole        = System.Windows.Forms.AccessibleRole.MenuItem;
     this.CareerToolStripMenuItem.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.CareerToolStripMenuItem.Font                  = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.CareerToolStripMenuItem.ForeColor             = System.Drawing.Color.White;
     this.CareerToolStripMenuItem.ImageScaling          = System.Windows.Forms.ToolStripItemImageScaling.None;
     this.CareerToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.White;
     this.CareerToolStripMenuItem.Name                  = "CareerToolStripMenuItem";
     this.CareerToolStripMenuItem.Size                  = new System.Drawing.Size(148, 22);
     this.CareerToolStripMenuItem.Text                  = "This is a test";
     this.CareerToolStripMenuItem.TextImageRelation     = System.Windows.Forms.TextImageRelation.Overlay;
     //
     // contextMenuStrip2
     //
     this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.jobBlogMittelstandToolStripMenuItem,
         this.arbeitsmarktToolStripMenuItem,
         this.mittelstandJobsToolStripMenuItem
     });
     this.contextMenuStrip2.Name            = "contextMenuStrip2";
     this.contextMenuStrip2.RenderMode      = System.Windows.Forms.ToolStripRenderMode.Professional;
     this.contextMenuStrip2.ShowImageMargin = false;
     this.contextMenuStrip2.Size            = new System.Drawing.Size(154, 70);
     //
     // jobBlogMittelstandToolStripMenuItem
     //
     this.jobBlogMittelstandToolStripMenuItem.Name   = "jobBlogMittelstandToolStripMenuItem";
     this.jobBlogMittelstandToolStripMenuItem.Size   = new System.Drawing.Size(153, 22);
     this.jobBlogMittelstandToolStripMenuItem.Text   = "JobBlog Mittelstand";
     this.jobBlogMittelstandToolStripMenuItem.Click += new System.EventHandler(this.jobBlogMittelstandToolStripMenuItem_Click);
     //
     // arbeitsmarktToolStripMenuItem
     //
     this.arbeitsmarktToolStripMenuItem.Name   = "arbeitsmarktToolStripMenuItem";
     this.arbeitsmarktToolStripMenuItem.Size   = new System.Drawing.Size(153, 22);
     this.arbeitsmarktToolStripMenuItem.Text   = "Arbeitsmarkt";
     this.arbeitsmarktToolStripMenuItem.Click += new System.EventHandler(this.arbeitsmarktToolStripMenuItem_Click);
     //
     // mittelstandJobsToolStripMenuItem
     //
     this.mittelstandJobsToolStripMenuItem.Name   = "mittelstandJobsToolStripMenuItem";
     this.mittelstandJobsToolStripMenuItem.Size   = new System.Drawing.Size(153, 22);
     this.mittelstandJobsToolStripMenuItem.Text   = "Mittelstand & Jobs";
     this.mittelstandJobsToolStripMenuItem.Click += new System.EventHandler(this.mittelstandJobsToolStripMenuItem_Click);
     //
     // comboSearchBox
     //
     this.comboSearchBox.AllowDrop         = true;
     this.comboSearchBox.Anchor            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
     this.comboSearchBox.CausesValidation  = false;
     this.comboSearchBox.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.Simple;
     this.comboSearchBox.Font              = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.comboSearchBox.FormattingEnabled = true;
     this.comboSearchBox.Location          = new System.Drawing.Point(877, 2);
     this.comboSearchBox.Name              = "comboSearchBox";
     this.comboSearchBox.Size              = new System.Drawing.Size(121, 150);
     this.comboSearchBox.TabIndex          = 16;
     //
     // panel1
     //
     this.panel1.BackColor   = System.Drawing.Color.White;
     this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.panel1.Controls.Add(this.button1);
     this.panel1.Controls.Add(this.searchBox);
     this.panel1.Location = new System.Drawing.Point(532, 1);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(200, 20);
     this.panel1.TabIndex = 13;
     //
     // button1
     //
     this.button1.BackgroundImage           = global::MKtoolbar.Properties.Resources.searchLogo;
     this.button1.BackgroundImageLayout     = System.Windows.Forms.ImageLayout.None;
     this.button1.FlatAppearance.BorderSize = 0;
     this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.button1.Location  = new System.Drawing.Point(1, -1);
     this.button1.Name      = "button1";
     this.button1.Size      = new System.Drawing.Size(32, 17);
     this.button1.TabIndex  = 0;
     this.button1.UseVisualStyleBackColor = true;
     //
     // searchBox
     //
     this.searchBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.searchBox.Font        = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.searchBox.ForeColor   = System.Drawing.SystemColors.ScrollBar;
     this.searchBox.Location    = new System.Drawing.Point(37, 2);
     this.searchBox.Multiline   = false;
     this.searchBox.Name        = "searchBox";
     this.searchBox.ScrollBars  = System.Windows.Forms.RichTextBoxScrollBars.None;
     this.searchBox.Size        = new System.Drawing.Size(158, 16);
     this.searchBox.TabIndex    = 14;
     this.searchBox.Text        = "Google Suche";
     this.searchBox.WordWrap    = false;
     this.searchBox.KeyPress   += new System.Windows.Forms.KeyPressEventHandler(this.richTextBox1_KeyPress);
     this.searchBox.Click      += new System.EventHandler(this.richTextBox1_Click);
     //
     // btnRssFeed
     //
     this.btnRssFeed.BackgroundImage           = global::MKtoolbar.Properties.Resources.rss_feed;
     this.btnRssFeed.BackgroundImageLayout     = System.Windows.Forms.ImageLayout.Stretch;
     this.btnRssFeed.FlatAppearance.BorderSize = 0;
     this.btnRssFeed.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this.btnRssFeed.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
     this.btnRssFeed.Location   = new System.Drawing.Point(273, 0);
     this.btnRssFeed.Name       = "btnRssFeed";
     this.btnRssFeed.Size       = new System.Drawing.Size(194, 21);
     this.btnRssFeed.TabIndex   = 12;
     this.btnRssFeed.UseVisualStyleBackColor = true;
     this.btnRssFeed.MouseLeave += new System.EventHandler(this.btnRssFeed_MouseLeave);
     this.btnRssFeed.Click      += new System.EventHandler(this.btnRssFeed_Click);
     this.btnRssFeed.MouseHover += new System.EventHandler(this.btnRssFeed_MouseHover);
     //
     // btnCareer
     //
     this.btnCareer.BackgroundImage           = global::MKtoolbar.Properties.Resources.careerImage;
     this.btnCareer.BackgroundImageLayout     = System.Windows.Forms.ImageLayout.Stretch;
     this.btnCareer.FlatAppearance.BorderSize = 0;
     this.btnCareer.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this.btnCareer.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
     this.btnCareer.Location   = new System.Drawing.Point(165, 2);
     this.btnCareer.Name       = "btnCareer";
     this.btnCareer.Size       = new System.Drawing.Size(108, 19);
     this.btnCareer.TabIndex   = 11;
     this.btnCareer.UseVisualStyleBackColor = true;
     this.btnCareer.MouseLeave += new System.EventHandler(this.btnCareer_MouseLeave);
     this.btnCareer.Click      += new System.EventHandler(this.btnCareer_Click);
     this.btnCareer.MouseHover += new System.EventHandler(this.btnCareer_MouseHover);
     //
     // lblMiddleDividerBar
     //
     this.lblMiddleDividerBar.Image    = global::MKtoolbar.Properties.Resources.middle_bar1;
     this.lblMiddleDividerBar.Location = new System.Drawing.Point(151, 2);
     this.lblMiddleDividerBar.Name     = "lblMiddleDividerBar";
     this.lblMiddleDividerBar.Size     = new System.Drawing.Size(5, 17);
     this.lblMiddleDividerBar.TabIndex = 10;
     //
     // lblmainLogo
     //
     this.lblmainLogo.Image      = global::MKtoolbar.Properties.Resources.toolbar_logo;
     this.lblmainLogo.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.lblmainLogo.Location   = new System.Drawing.Point(6, -1);
     this.lblmainLogo.Name       = "lblmainLogo";
     this.lblmainLogo.Size       = new System.Drawing.Size(157, 21);
     this.lblmainLogo.TabIndex   = 9;
     this.lblmainLogo.Click     += new System.EventHandler(this.lblmainLogo_Click);
     //
     // dottedBar
     //
     this.dottedBar.ForeColor = System.Drawing.Color.Red;
     this.dottedBar.Image     = global::MKtoolbar.Properties.Resources.left_dot_bar;
     this.dottedBar.Location  = new System.Drawing.Point(-1, 0);
     this.dottedBar.Name      = "dottedBar";
     this.dottedBar.Size      = new System.Drawing.Size(8, 19);
     this.dottedBar.TabIndex  = 8;
     this.dottedBar.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // btnGO
     //
     this.btnGO.FlatAppearance.BorderSize = 0;
     this.btnGO.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this.btnGO.Font       = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
     this.btnGO.Image      = global::MKtoolbar.Properties.Resources.go_arrow;
     this.btnGO.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.btnGO.Location   = new System.Drawing.Point(733, 0);
     this.btnGO.Name       = "btnGO";
     this.btnGO.Size       = new System.Drawing.Size(53, 23);
     this.btnGO.TabIndex   = 14;
     this.btnGO.Text       = "GO";
     this.btnGO.TextAlign  = System.Drawing.ContentAlignment.MiddleRight;
     this.btnGO.UseVisualStyleBackColor = true;
     this.btnGO.Click += new System.EventHandler(this.btnGO_Click);
     //
     // MKtoolbar
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.AutoSizeMode        = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(222)))));
     this.Controls.Add(this.btnRssFeed);
     this.Controls.Add(this.btnCareer);
     this.Controls.Add(this.lblMiddleDividerBar);
     this.Controls.Add(this.lblmainLogo);
     this.Controls.Add(this.dottedBar);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.btnGO);
     this.Font        = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.MinimumSize = new System.Drawing.Size(800, 21);
     this.MinSize     = new System.Drawing.Size(800, 21);
     this.Name        = "MKtoolbar";
     this.Size        = new System.Drawing.Size(800, 21);
     this.Load       += new System.EventHandler(this.MKtoolbar_Load);
     this.contextMenuStrip1.ResumeLayout(false);
     this.contextMenuStrip2.ResumeLayout(false);
     this.panel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     ToolBar window = new ToolBar();
     window.Show();
 }
Esempio n. 19
0
        private void InitializeComponent()
        {
            this.components = (IContainer) new Container();
            ResourceManager resourceManager = new ResourceManager(typeof(frmLecturista));

            this.tbBarra                 = new ToolBar();
            this.btnAgregar              = new ToolBarButton();
            this.btnModificar            = new ToolBarButton();
            this.btnInactivar            = new ToolBarButton();
            this.spSep1                  = new ToolBarButton();
            this.btnBuscar               = new ToolBarButton();
            this.spSep2                  = new ToolBarButton();
            this.btnActualizar           = new ToolBarButton();
            this.spSep3                  = new ToolBarButton();
            this.btnCerrar               = new ToolBarButton();
            this.imgImagenes             = new ImageList(this.components);
            this.grdLecturista           = new DataGrid();
            this.dataGridTableStyle1     = new DataGridTableStyle();
            this.grdClave                = new DataGridTextBoxColumn();
            this.grdEmpleado             = new DataGridTextBoxColumn();
            this.grdcolNombreLecturista  = new DataGridTextBoxColumn();
            this.grdcolUsuarioLecturista = new DataGridTextBoxColumn();
            this.grdcolNumeroCelular     = new DataGridTextBoxColumn();
            this.grdcolStatus            = new DataGridTextBoxColumn();
            this.grdcolPDADescripcion    = new DataGridTextBoxColumn();
            this.grdLecturista.BeginInit();
            this.SuspendLayout();
            this.tbBarra.Appearance = ToolBarAppearance.Flat;
            this.tbBarra.Buttons.AddRange(new ToolBarButton[9]
            {
                this.btnAgregar,
                this.btnModificar,
                this.btnInactivar,
                this.spSep1,
                this.btnBuscar,
                this.spSep2,
                this.btnActualizar,
                this.spSep3,
                this.btnCerrar
            });
            this.tbBarra.DropDownArrows        = true;
            this.tbBarra.ImageList             = this.imgImagenes;
            this.tbBarra.Name                  = "tbBarra";
            this.tbBarra.ShowToolTips          = true;
            this.tbBarra.Size                  = new Size(786, 39);
            this.tbBarra.TabIndex              = 4;
            this.tbBarra.ButtonClick          += new ToolBarButtonClickEventHandler(this.tbBarra_ButtonClick);
            this.btnAgregar.ImageIndex         = 0;
            this.btnAgregar.Text               = "Agregar";
            this.btnModificar.ImageIndex       = 1;
            this.btnModificar.Text             = "Modificar";
            this.btnInactivar.ImageIndex       = 2;
            this.btnInactivar.Text             = "Inactivar";
            this.spSep1.Style                  = ToolBarButtonStyle.Separator;
            this.btnBuscar.ImageIndex          = 3;
            this.btnBuscar.Text                = "Buscar";
            this.spSep2.Style                  = ToolBarButtonStyle.Separator;
            this.btnActualizar.ImageIndex      = 4;
            this.btnActualizar.Text            = "Actualizar";
            this.spSep3.Style                  = ToolBarButtonStyle.Separator;
            this.btnCerrar.ImageIndex          = 5;
            this.btnCerrar.Text                = "Cerrar";
            this.imgImagenes.ColorDepth        = ColorDepth.Depth8Bit;
            this.imgImagenes.ImageSize         = new Size(16, 16);
            this.imgImagenes.ImageStream       = (ImageListStreamer)resourceManager.GetObject("imgImagenes.ImageStream");
            this.imgImagenes.TransparentColor  = Color.Transparent;
            this.grdLecturista.CaptionText     = "Lecturistas";
            this.grdLecturista.CaptionVisible  = false;
            this.grdLecturista.DataMember      = "";
            this.grdLecturista.Dock            = DockStyle.Fill;
            this.grdLecturista.HeaderForeColor = SystemColors.ControlText;
            this.grdLecturista.Location        = new Point(0, 39);
            this.grdLecturista.Name            = "grdLecturista";
            this.grdLecturista.ReadOnly        = true;
            this.grdLecturista.Size            = new Size(786, 529);
            this.grdLecturista.TabIndex        = 6;
            this.grdLecturista.TableStyles.AddRange(new DataGridTableStyle[1]
            {
                this.dataGridTableStyle1
            });
            this.grdLecturista.CurrentCellChanged        += new EventHandler(this.grdLecturista_CurrentCellChanged);
            this.dataGridTableStyle1.AlternatingBackColor = Color.Gainsboro;
            this.dataGridTableStyle1.DataGrid             = this.grdLecturista;
            this.dataGridTableStyle1.GridColumnStyles.AddRange(new DataGridColumnStyle[7]
            {
                (DataGridColumnStyle)this.grdClave,
                (DataGridColumnStyle)this.grdEmpleado,
                (DataGridColumnStyle)this.grdcolNombreLecturista,
                (DataGridColumnStyle)this.grdcolUsuarioLecturista,
                (DataGridColumnStyle)this.grdcolNumeroCelular,
                (DataGridColumnStyle)this.grdcolStatus,
                (DataGridColumnStyle)this.grdcolPDADescripcion
            });
            this.dataGridTableStyle1.HeaderForeColor      = SystemColors.ControlText;
            this.dataGridTableStyle1.MappingName          = "Lecturista";
            this.dataGridTableStyle1.PreferredColumnWidth = 250;
            this.dataGridTableStyle1.ReadOnly             = true;
            this.grdClave.Format                     = "";
            this.grdClave.FormatInfo                 = (IFormatProvider)null;
            this.grdClave.MappingName                = "Lecturista";
            this.grdClave.ReadOnly                   = true;
            this.grdClave.Width                      = 0;
            this.grdEmpleado.Format                  = "";
            this.grdEmpleado.FormatInfo              = (IFormatProvider)null;
            this.grdEmpleado.HeaderText              = "Empleado";
            this.grdEmpleado.MappingName             = "Empleado";
            this.grdEmpleado.ReadOnly                = true;
            this.grdEmpleado.Width                   = 65;
            this.grdcolNombreLecturista.Format       = "";
            this.grdcolNombreLecturista.FormatInfo   = (IFormatProvider)null;
            this.grdcolNombreLecturista.HeaderText   = "Nombre Lecturista";
            this.grdcolNombreLecturista.MappingName  = "Nombre";
            this.grdcolNombreLecturista.ReadOnly     = true;
            this.grdcolNombreLecturista.Width        = 200;
            this.grdcolUsuarioLecturista.Format      = "";
            this.grdcolUsuarioLecturista.FormatInfo  = (IFormatProvider)null;
            this.grdcolUsuarioLecturista.HeaderText  = "Usuario Lecturista";
            this.grdcolUsuarioLecturista.MappingName = "UsuarioLecturista";
            this.grdcolUsuarioLecturista.ReadOnly    = true;
            this.grdcolUsuarioLecturista.Width       = 105;
            this.grdcolNumeroCelular.Format          = "";
            this.grdcolNumeroCelular.FormatInfo      = (IFormatProvider)null;
            this.grdcolNumeroCelular.HeaderText      = "Número Celular";
            this.grdcolNumeroCelular.MappingName     = "NumeroCelular";
            this.grdcolNumeroCelular.ReadOnly        = true;
            this.grdcolNumeroCelular.Width           = 105;
            this.grdcolStatus.Format                 = "";
            this.grdcolStatus.FormatInfo             = (IFormatProvider)null;
            this.grdcolStatus.HeaderText             = "Status";
            this.grdcolStatus.MappingName            = "Status";
            this.grdcolStatus.ReadOnly               = true;
            this.grdcolStatus.Width                  = 75;
            this.grdcolPDADescripcion.Format         = "";
            this.grdcolPDADescripcion.FormatInfo     = (IFormatProvider)null;
            this.grdcolPDADescripcion.HeaderText     = "Observación";
            this.grdcolPDADescripcion.MappingName    = "PDADescripcion";
            this.grdcolPDADescripcion.ReadOnly       = true;
            this.grdcolPDADescripcion.Width          = 175;
            this.AutoScaleBaseSize                   = new Size(5, 13);
            this.ClientSize = new Size(786, 568);
            this.Controls.AddRange(new Control[2]
            {
                (Control)this.grdLecturista,
                (Control)this.tbBarra
            });
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
            this.Name            = "frmLecturista";
            this.ShowInTaskbar   = false;
            this.StartPosition   = FormStartPosition.CenterParent;
            this.Text            = "Catálogo de Lecturistas";
            this.Load           += new EventHandler(this.frmLecturista_Load);
            this.grdLecturista.EndInit();
            this.ResumeLayout(false);
        }
Esempio n. 20
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ToolBarTray_Main = (ToolBarTray)target;
                return;

            case 2:
                this.ToolBar_Controls = (ToolBar)target;
                return;

            case 3:
                this.Button_New = (Button)target;
                return;

            case 4:
                this.Button_Open = (Button)target;
                return;

            case 5:
                this.Button_Save = (Button)target;
                return;

            case 6:
                this.Button_SaveAll = (Button)target;
                return;

            case 7:
                this.Button_Cut = (Button)target;
                return;

            case 8:
                this.Button_Copy = (Button)target;
                return;

            case 9:
                this.Button_Paste = (Button)target;
                return;

            case 10:
                this.Button_Delete = (Button)target;
                return;

            case 11:
                this.Button_Undo = (Button)target;
                return;

            case 12:
                this.Button_Redo = (Button)target;
                return;

            case 13:
                this.Button_Bold = (Button)target;
                return;

            case 14:
                this.Button_Italic = (Button)target;
                return;

            case 15:
                this.Button_Quote = (Button)target;
                return;

            case 16:
                this.Button_Code = (Button)target;
                return;

            case 17:
                this.Button_H1 = (Button)target;
                return;

            case 18:
                this.Button_H2 = (Button)target;
                return;

            case 19:
                this.Button_Hyperlink = (Button)target;
                return;

            case 20:
                this.Button_Image = (Button)target;
                return;

            case 21:
                this.Button_UnorderedList = (Button)target;
                return;

            case 22:
                this.Button_OrderedList = (Button)target;
                return;

            case 23:
                this.Button_HorizontalRule = (Button)target;
                return;

            case 24:
                this.Button_Uppercase = (Button)target;
                return;

            case 25:
                this.Button_Lowercase = (Button)target;
                return;

            case 26:
                this.Button_Timestamp = (Button)target;
                return;

            case 27:
                this.Button_ToggleLayout = (Button)target;
                return;

            case 28:
                this.Button_LivePreview = (ToggleButton)target;
                return;

            case 29:
                this.Button_PreviewMarkdown = (Button)target;
                return;

            default:
                this._contentLoaded = true;
                return;
            }
        }
Esempio n. 21
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);
        }
Esempio n. 22
0
        public void Active()
        {
            if (MyControl == null)
            {
                return;
            }


            if (!string.IsNullOrEmpty(MyPaletteHeader))
            {
                CMNApplication.ShowESWCmn();
                //add toolbar
                Panel masterPanel = new Panel()
                {
                    Dock = DockStyle.Fill
                };

                mToolbar = new ToolBar()
                {
                    ImageList      = new ImageList(),
                    Location       = new Point(20, 20),
                    Appearance     = ToolBarAppearance.Flat,
                    ButtonSize     = new Size(16, 16),
                    Divider        = false,
                    Dock           = DockStyle.Top,
                    DropDownArrows = true,
                };

                object obj = GlobalResource.ResourceManager.GetObject("gtk_cancel");
                if (obj != null)
                {
                    if (obj is Bitmap)
                    {
                        this.mToolbar.ImageList.Images.Add((System.Drawing.Image)obj, Color.Magenta);
                    }
                    else
                    {
                        this.mToolbar.ImageList.Images.Add((Icon)obj);
                    }
                }

                ToolBarButton closeButton = new ToolBarButton()
                {
                    ImageIndex = 0, ToolTipText = "Close", Tag = "CLOSE"
                };
                mToolbar.Buttons.Add(closeButton);
                mToolbar.ButtonClick += mToolbar_ButtonClick;
                SplitContainer sc = new SplitContainer()
                {
                    Orientation      = Orientation.Horizontal,
                    IsSplitterFixed  = true,
                    FixedPanel       = FixedPanel.Panel1,
                    SplitterDistance = 20,
                    Dock             = DockStyle.Fill
                };
                sc.Panel1.Controls.Add(mToolbar);
                MyControl.Dock = DockStyle.Fill;
                masterPanel.Controls.Add(MyControl);

                sc.Panel2.Controls.Add(masterPanel);
                List <string> paletteNames = new List <string>();
                for (int i = 0; i < CMNApplication.ESWCmn.ESW.Count; i++)
                {
                    paletteNames.Add(CMNApplication.ESWCmn.ESW[i].Name);
                }

                if (!paletteNames.Contains(this.MyPaletteHeader))
                {
                    CMNApplication.ESWCmn.Add(MyPaletteHeader, sc);
                }
                for (int i = 0; i < CMNApplication.ESWCmn.ESW.Count; i++)
                {
                    if (CMNApplication.ESWCmn.ESW[i].Name == this.MyPaletteHeader)
                    {
                        CMNApplication.ESWCmn.ESW.Activate(i);
                        return;
                    }
                }
            }
        }
Esempio n. 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.spgviewSupplier = new SPGridView();
            this.spgviewSupplier.AutoGenerateColumns = false;
            Tlist[0] = "生产厂商名称:ManufacturerName";
            Tlist[1] = "生产厂商编码:ManufacturerCode";
            Tlist[2] = "生产厂商类别:ManufacturerTypeName";
            Tlist[3] = "联系地址1:ManufacturerAddress1";
            Tlist[4] = "联系地址2:ManufacturerAddress2";
            Tlist[5] = "联系电话:ManufacturerPhone";
            Tlist[6] = "负责人:principal";
            Tlist[7] = "备注:Remark";
            BindGridView();
            //添加按钮到toolbar
            ToolBar tbarTop = (ToolBar)GetControltByMaster("tbarEmployee");
            //新建
            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 tbarbtnImp = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarbtnImp.ID       = "ImpExcel";
            tbarbtnImp.Text     = "导入";
            tbarbtnImp.ImageUrl = "/_layouts/images/edit.gif";
            tbarbtnImp.Click   += new EventHandler(tbarbtnImp_Click);
            tbarTop.Buttons.Controls.Add(tbarbtnImp);

            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);
        }
Esempio n. 24
0
 ///
 public ToolBarAutomationPeer(ToolBar owner) : base(owner)
 {
 }
Esempio n. 25
0
        private void ShowTestDialog()
        {
            int count   = 0;
            var toolBar = new ToolBar();
            var dlg     = new Dialog
            {
                ClientSize = new Size(400, 300),
                Resizable  = true,
                ToolBar    = toolBar
            };

            dlg.Styles.Add <Label>(null, l => l.VerticalAlignment = VerticalAlignment.Center);

            var indexStepper = new NumericStepper {
                MinValue = -1, MaxValue = -1, Value = -1
            };
            var typeDropDown = new DropDown
            {
                Items         = { "Button", "Radio", "Check", "Separator:Divider", "Separator:Space", "Separator:FlexableSpace" },
                SelectedIndex = 0
            };

            var withImageCheck = new CheckBox {
                Text = "With Image", Checked = true
            };

            Image GetImage()
            {
                if (withImageCheck.Checked == true)
                {
                    return(TestIcons.TestIcon);
                }
                return(null);
            }

            void SetStepperLimit()
            {
                if (toolBar.Items.Count == 0)
                {
                    indexStepper.MinValue = indexStepper.MaxValue = -1;
                }
                else
                {
                    indexStepper.MinValue = 0;
                    indexStepper.MaxValue = toolBar.Items.Count - 1;
                }
            }

            ToolItem CreateItem()
            {
                switch (typeDropDown.SelectedKey?.ToLowerInvariant())
                {
                default:
                case "button":
                    return(new ButtonToolItem {
                        Text = $"Button{++count}", Image = GetImage()
                    });

                case "radio":
                    return(new RadioToolItem {
                        Text = $"Radio{++count}", Image = GetImage()
                    });

                case "check":
                    return(new CheckToolItem {
                        Text = $"Check{++count}", Image = GetImage()
                    });

                case "separator:divider":
                    return(new SeparatorToolItem {
                        Type = SeparatorToolItemType.Divider
                    });

                case "separator:space":
                    return(new SeparatorToolItem {
                        Type = SeparatorToolItemType.Space
                    });

                case "separator:flexablespace":
                    return(new SeparatorToolItem {
                        Type = SeparatorToolItemType.FlexibleSpace
                    });
                }
            }

            var addButton = new Button {
                Text = "Add"
            };

            addButton.Click += (sender, e) =>
            {
                toolBar.Items.Add(CreateItem());
                SetStepperLimit();
            };

            var removeButton = new Button {
                Text = "Remove"
            };

            removeButton.Click += (sender, e) =>
            {
                var index = (int)indexStepper.Value;
                if (index >= 0)
                {
                    toolBar.Items.RemoveAt(index);
                }
                SetStepperLimit();
            };

            var insertButton = new Button {
                Text = "Insert"
            };

            insertButton.Click += (sender, e) =>
            {
                var index = (int)indexStepper.Value;
                if (index >= 0)
                {
                    toolBar.Items.Insert(index, CreateItem());
                }
                SetStepperLimit();
            };

            var clearButton = new Button {
                Text = "Clear"
            };

            clearButton.Click += (sender, e) =>
            {
                toolBar.Items.Clear();
                SetStepperLimit();
            };

            var layout = new DynamicLayout();

            layout.BeginCentered(yscale: true);
            layout.AddSeparateRow(null, "Type:", typeDropDown, withImageCheck, null);
            layout.AddSeparateRow(null, addButton, insertButton, removeButton, "Index:", indexStepper, null);
            layout.AddSeparateRow(null, clearButton, null);
            layout.EndCentered();

            dlg.Content = layout;


            dlg.ShowModal();
        }
Esempio n. 26
0
        public TaskControls(Manager manager) : base(manager)
        {
            MinimumWidth  = 340;
            MinimumHeight = 140;
            Height        = 480;
            Center();
            Text = "Controls Test";

            TopPanel.Visible  = true;
            Caption.Text      = "Information";
            Description.Text  = "Demonstration of various controls available in Neoforce Controls library.";
            Caption.TextColor = Description.TextColor = new Color(96, 96, 96);

            grpEdit = new GroupPanel(Manager);
            grpEdit.Init();
            grpEdit.Parent = this;
            grpEdit.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
            grpEdit.Width  = ClientWidth - 200;
            grpEdit.Height = 160;
            grpEdit.Left   = 8;
            grpEdit.Top    = TopPanel.Height + 8;
            grpEdit.Text   = "EditBox";

            pnlControls = new Panel(Manager);
            pnlControls.Init();
            pnlControls.Passive     = true;
            pnlControls.Parent      = this;
            pnlControls.Anchor      = Anchors.Left | Anchors.Top | Anchors.Right;
            pnlControls.Left        = 8;
            pnlControls.Top         = grpEdit.Top + grpEdit.Height + 8;
            pnlControls.Width       = ClientWidth - 200;
            pnlControls.Height      = BottomPanel.Top - 32 - pnlControls.Top;
            pnlControls.BevelBorder = BevelBorder.All;
            pnlControls.BevelMargin = 1;
            pnlControls.BevelStyle  = BevelStyle.Etched;
            pnlControls.Color       = Color.Transparent;

            lblEdit = new Label(manager);
            lblEdit.Init();
            lblEdit.Parent = grpEdit;
            lblEdit.Left   = 16;
            lblEdit.Top    = 8;
            lblEdit.Text   = "Testing field:";
            lblEdit.Width  = 128;
            lblEdit.Height = 16;

            txtEdit = new TextBox(manager);
            txtEdit.Init();
            txtEdit.Parent = grpEdit;
            txtEdit.Left   = 16;
            txtEdit.Top    = 24;
            txtEdit.Width  = grpEdit.ClientWidth - 32;
            txtEdit.Height = 20;
            txtEdit.Anchor = Anchors.Left | Anchors.Top | Anchors.Right | Anchors.Bottom;
            txtEdit.Text   = "Text";

            rdbNormal = new RadioButton(manager);
            rdbNormal.Init();
            rdbNormal.Parent          = grpEdit;
            rdbNormal.Left            = 16;
            rdbNormal.Top             = 52;
            rdbNormal.Width           = grpEdit.ClientWidth - 32;
            rdbNormal.Anchor          = Anchors.Left | Anchors.Bottom | Anchors.Right;
            rdbNormal.Checked         = true;
            rdbNormal.Text            = "Normal mode";
            rdbNormal.ToolTip.Text    = "Enables normal mode for TextBox control.";
            rdbNormal.CheckedChanged += ModeChanged;

            rdbPassword = new RadioButton(manager);
            rdbPassword.Init();
            rdbPassword.Parent          = grpEdit;
            rdbPassword.Left            = 16;
            rdbPassword.Top             = 68;
            rdbPassword.Width           = grpEdit.ClientWidth - 32;
            rdbPassword.Anchor          = Anchors.Left | Anchors.Bottom | Anchors.Right;
            rdbPassword.Checked         = false;
            rdbPassword.Text            = "Password mode";
            rdbPassword.ToolTip.Text    = "Enables password mode for TextBox control.";
            rdbPassword.CheckedChanged += ModeChanged;

            chkBorders = new CheckBox(manager);
            chkBorders.Init();
            chkBorders.Parent          = grpEdit;
            chkBorders.Left            = 16;
            chkBorders.Top             = 96;
            chkBorders.Width           = grpEdit.ClientWidth - 32;
            chkBorders.Anchor          = Anchors.Left | Anchors.Bottom | Anchors.Right;
            chkBorders.Checked         = false;
            chkBorders.Text            = "Borderless mode";
            chkBorders.ToolTip.Text    = "Enables or disables borderless mode for TextBox control.";
            chkBorders.CheckedChanged += chkBorders_CheckedChanged;

            chkReadOnly = new CheckBox(manager);
            chkReadOnly.Init();
            chkReadOnly.Parent       = grpEdit;
            chkReadOnly.Left         = 16;
            chkReadOnly.Top          = 110;
            chkReadOnly.Width        = grpEdit.ClientWidth - 32;
            chkReadOnly.Anchor       = Anchors.Left | Anchors.Bottom | Anchors.Right;
            chkReadOnly.Checked      = false;
            chkReadOnly.Text         = "Read only mode";
            chkReadOnly.ToolTip.Text =
                "Enables or disables read only mode for TextBox control.\nThis mode is necessary to enable explicitly.";
            chkReadOnly.CheckedChanged += chkReadOnly_CheckedChanged;

            string[] colors =
            {
                "Red",    "Green", "Blue",   "Yellow", "Orange",  "Purple", "White", "Black", "Magenta", "Cyan",
                "Brown",  "Aqua",  "Beige",  "Coral",  "Crimson", "Gray",   "Azure", "Ivory", "Indigo",  "Khaki",
                "Orchid", "Plum",  "Salmon", "Silver", "Gold",    "Pink",   "Linen", "Lime",  "Olive",   "Slate"
            };

            spnMain = new SpinBox(manager, SpinBoxMode.List);
            spnMain.Init();
            spnMain.Parent = pnlControls;
            spnMain.Left   = 16;
            spnMain.Top    = 16;
            spnMain.Width  = pnlControls.Width - 32;
            spnMain.Height = 20;
            spnMain.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
            spnMain.Items.AddRange(colors);
            spnMain.Mode = SpinBoxMode.Range;

            spnMain.ItemIndex = 0;

            cmbMain = new ComboBox(manager);
            cmbMain.Init();
            cmbMain.Parent   = pnlControls;
            cmbMain.Left     = 16;
            cmbMain.Top      = 44;
            cmbMain.Width    = pnlControls.Width - 32;
            cmbMain.Height   = 20;
            cmbMain.ReadOnly = true;
            cmbMain.Anchor   = Anchors.Left | Anchors.Top | Anchors.Right;
            cmbMain.Items.AddRange(colors);
            cmbMain.ItemIndex     = 0;
            cmbMain.MaxItems      = 5;
            cmbMain.ToolTip.Color = Color.Yellow;
            cmbMain.Movable       = cmbMain.Resizable = true;
            cmbMain.OutlineMoving = cmbMain.OutlineResizing = true;

            trkMain = new TrackBar(manager);
            trkMain.Init();
            trkMain.Parent        = pnlControls;
            trkMain.Left          = 16;
            trkMain.Top           = 72;
            trkMain.Width         = pnlControls.Width - 32;
            trkMain.Anchor        = Anchors.Left | Anchors.Top | Anchors.Right;
            trkMain.Range         = 64;
            trkMain.Value         = 16;
            trkMain.ValueChanged += trkMain_ValueChanged;

            lblTrack = new Label(manager);
            lblTrack.Init();
            lblTrack.Parent    = pnlControls;
            lblTrack.Left      = 16;
            lblTrack.Top       = 96;
            lblTrack.Width     = pnlControls.Width - 32;
            lblTrack.Anchor    = Anchors.Left | Anchors.Top | Anchors.Right;
            lblTrack.Alignment = Alignment.TopRight;
            lblTrack.TextColor = new Color(32, 32, 32);
            trkMain_ValueChanged(this, null); // forcing label redraw with init values

            mnuListBox = new ContextMenu(manager);

            var i1 = new MenuItem("This is very long text");
            var i2 = new MenuItem("Menu", true);
            var i3 = new MenuItem("Item", false);
            //i3.Enabled = false;
            var i4 = new MenuItem("Separated", true);

            var i11 = new MenuItem();
            var i12 = new MenuItem();
            var i13 = new MenuItem();
            var i14 = new MenuItem();

            var i111 = new MenuItem();
            var i112 = new MenuItem();
            var i113 = new MenuItem();

            mnuListBox.Items.AddRange(new[] { i1, i2, i3, i4 });
            i2.Items.AddRange(new[] { i11, i12, i13, i14 });
            i13.Items.AddRange(new[] { i111, i112, i113 });


            lstMain = new ListBox(manager);
            lstMain.Init();
            lstMain.Parent        = this;
            lstMain.Top           = TopPanel.Height + 8;
            lstMain.Left          = grpEdit.Left + grpEdit.Width + 8;
            lstMain.Width         = ClientWidth - lstMain.Left - 8;
            lstMain.Height        = ClientHeight - 16 - BottomPanel.Height - TopPanel.Height;
            lstMain.Anchor        = Anchors.Top | Anchors.Right | Anchors.Bottom;
            lstMain.HideSelection = false;
            lstMain.Items.AddRange(colors);
            lstMain.ContextMenu = mnuListBox;

            prgMain = new ProgressBar(manager);
            prgMain.Init();
            prgMain.Parent  = BottomPanel;
            prgMain.Left    = lstMain.Left;
            prgMain.Top     = 10;
            prgMain.Width   = lstMain.Width;
            prgMain.Height  = 16;
            prgMain.Anchor  = Anchors.Top | Anchors.Right;
            prgMain.Mode    = ProgressBarMode.Infinite;
            prgMain.Passive = false;

            btnDisable = new Button(manager);
            btnDisable.Init();
            btnDisable.Parent    = BottomPanel;
            btnDisable.Left      = 8;
            btnDisable.Top       = 8;
            btnDisable.Text      = "Disable";
            btnDisable.Click    += btnDisable_Click;
            btnDisable.TextColor = Color.FromNonPremultiplied(255, 64, 32, 200);

            btnProgress = new Button(manager);
            btnProgress.Init();
            btnProgress.Parent = BottomPanel;
            btnProgress.Left   = prgMain.Left - 16;
            btnProgress.Top    = prgMain.Top;
            btnProgress.Height = 16;
            btnProgress.Width  = 16;
            btnProgress.Text   = "!";
            btnProgress.Anchor = Anchors.Top | Anchors.Right;
            btnProgress.Click += btnProgress_Click;

            mnuMain = new MainMenu(manager);

            mnuMain.Items.Add(i2);
            mnuMain.Items.Add(i13);
            mnuMain.Items.Add(i3);
            mnuMain.Items.Add(i4);

            MainMenu = mnuMain;

            var tlp = new ToolBarPanel(manager);

            ToolBarPanel = tlp;

            var tlb  = new ToolBar(manager);
            var tlbx = new ToolBar(manager);

            tlb.FullRow  = true;
            tlbx.Row     = 1;
            tlbx.FullRow = false;

            tlp.Add(tlb);
            tlp.Add(tlbx);

            /*
             * tlb.Init();
             * tlb.Width = 256;
             * tlb.Parent = ToolBarPanel;*/


            //tlbx.Init();

            /*
             * tlbx.Width = 512;
             * tlbx.Top = 25;
             * tlbx.Parent = ToolBarPanel;*/

            /*
             * ToolBarButton tb1 = new ToolBarButton(manager);
             * tb1.Init();
             * tb1.Parent = tlb;
             * tb1.Left = 10;
             * tb1.Top = 1;
             * tb1.Glyph = new Glyph(Manager.Skin.Images["Icon.Warning"].Resource);
             * tb1.Glyph.SizeMode = SizeMode.Stretched;  */

            var stb = new StatusBar(Manager);

            StatusBar = stb;

            DefaultControl = txtEdit;

            OutlineMoving   = true;
            OutlineResizing = true;

            BottomPanel.BringToFront();

            SkinChanged += TaskControls_SkinChanged;
            TaskControls_SkinChanged(null, null);
        }
Esempio n. 27
0
        public override void Initialize()
        {
            //Edit
            var undo = new MenuItem("Undo", Undo).WithIcon("Resources/Icons/Icons.16x16.UndoIcon.png")
                       .WithGlobalShortcut(ModifierKeys.Control, Key.Z);
            var redo = new MenuItem("Redo", Redo).WithIcon("Resources/Icons/Icons.16x16.RedoIcon.png")
                       .WithGlobalShortcut(ModifierKeys.Control, Key.Y);
            var cut = new MenuItem("Cut", Cut).WithIcon("Resources/Icons/Icons.16x16.CutIcon.png")
                      .WithGlobalShortcut(ModifierKeys.Control, Key.X);
            var copy = new MenuItem("Copy", Copy).WithIcon("Resources/Icons/Icons.16x16.CopyIcon.png")
                       .WithGlobalShortcut(ModifierKeys.Control, Key.C);
            var paste = new MenuItem("Paste", Paste).WithIcon("Resources/Icons/Icons.16x16.PasteIcon.png")
                        .WithGlobalShortcut(ModifierKeys.Control, Key.V);
            var selectAll = new MenuItem("Select All", SelectAll)
                            .WithGlobalShortcut(ModifierKeys.Control, Key.A);
            var comment = new MenuItem("Comment Selection", Comment).WithIcon("Resources/Icons/Icons.16x16.CommentRegion.png")
                          .WithGlobalShortcut(ModifierKeys.Control, Key.K);
            var uncomment = new MenuItem("Uncomment Selection", Uncomment).WithIcon("Resources/Icons/Icons.16x16.CommentRegion.png")
                            .WithGlobalShortcut(ModifierKeys.Control, Key.U);

            //populate the menu
            MainMenu.First(item => item.Name == "Edit")
            .Add(
                undo,
                redo,
                MenuItemBase.Separator,
                cut,
                copy,
                paste,
                MenuItemBase.Separator,
                selectAll,
                MenuItemBase.Separator,
                comment,
                uncomment
                );
            //populate the toolbar
            ToolBar.Add(
                MenuItemBase.Separator,
                cut,
                copy,
                paste,
                MenuItemBase.Separator,
                undo,
                redo
                );


            //eval code
            var runFile = new MenuItem("Run", ExecuteFile)
                          .WithIcon("Resources/Icons/Icons.16x16.RunAllIcon.png")
                          .WithActivator(workspaceActivator)
                          .WithGlobalShortcut(ModifierKeys.Alt | ModifierKeys.Shift, Key.Enter);
            var runSelection = new MenuItem("Run Selection", ExecuteSelection)
                               .WithIcon("Resources/Icons/Icons.16x16.RunProgramIcon.png")
                               .WithActivator(workspaceActivator)
                               .WithGlobalShortcut(ModifierKeys.Alt, Key.Enter);

            //populate the menu
            MainMenu.First(item => item.Name == "Evaluate")
            .Add(
                runFile,
                runSelection
                );
            //populate the toolbar
            ToolBar.Add(
                MenuItemBase.Separator,
                runFile,
                runSelection
                );
        }
Esempio n. 28
0
        public Form1()
        {
            InitializeComponent();

            //Close the program when OK/Cancel/Help buttons are pressed
            cmdOK.Text        = "&OK";
            cmdOK.Enabled     = false;
            cmdOK.Click      += new EventHandler(this.ApplyChanges);
            cmdCancel.Text    = "&Cancel";
            cmdCancel.Enabled = false;
            cmdCancel.Click  += new EventHandler(this.ApplyChanges);
            cmdHelp.Text      = "&Help";
            cmdEdit.Text      = "&Edit";
            cmdEdit.Click    += new EventHandler(this.EditFields);

            //Do the menu
            mnu       = new MainMenu();
            this.Menu = mnu;
            MenuItem Top = new MenuItem("&File");

            mnu.MenuItems.Add(Top);
            MenuItem Next = new MenuItem("&New", new EventHandler(this.MenuHandler));

            Next.Shortcut = Shortcut.F5;
            Top.MenuItems.Add(Next);
            Next          = new MenuItem("&Save", new EventHandler(this.MenuHandler));
            Next.Shortcut = Shortcut.F6;
            Top.MenuItems.Add(Next);
            Next = new MenuItem("-");
            Top.MenuItems.Add(Next);
            Next          = new MenuItem("E&xit", new EventHandler(this.MenuHandler));
            Next.Shortcut = Shortcut.F12;
            Top.MenuItems.Add(Next);

            Top = new MenuItem("&Record");
            mnu.MenuItems.Add(Top);
            Next          = new MenuItem("&Previous", new EventHandler(this.MenuHandler));
            Next.Shortcut = Shortcut.F7;
            Top.MenuItems.Add(Next);
            Next          = new MenuItem("N&ext", new EventHandler(this.MenuHandler));
            Next.Shortcut = Shortcut.F8;
            Top.MenuItems.Add(Next);

            Top = new MenuItem("&Help");
            mnu.MenuItems.Add(Top);
            Next          = new MenuItem("&Help", new EventHandler(this.MenuHandler));
            Next.Shortcut = Shortcut.F1;
            Top.MenuItems.Add(Next);
            Next = new MenuItem("&About", new EventHandler(this.MenuHandler));
            Top.MenuItems.Add(Next);

            //Do the images for the toolbar and buttons
            imgToolBar.Images.Clear();
            imgToolBar.Images.Add(Image.FromFile("new.ico"));
            imgToolBar.Images.Add(Image.FromFile("save.ico"));
            imgToolBar.Images.Add(Image.FromFile("delete.ico"));
            imgToolBar.Images.Add(Image.FromFile("prev.ico"));
            imgToolBar.Images.Add(Image.FromFile("next.ico"));
            imgToolBar.Images.Add(Image.FromFile("help.ico"));
            imgToolBar.Images.Add(Image.FromFile("search.ico"));

            //Do the toolbar
            tb1 = new ToolBar();
            this.Controls.Add(tb1);
            tb1.ImageList    = imgToolBar;
            tb1.Appearance   = ToolBarAppearance.Flat;
            tb1.ButtonClick += new ToolBarButtonClickEventHandler(this.ToolBarHandler);

            //Make a space that we can add when we want to
            ToolBarButton btnSpacer = new ToolBarButton();

            btnSpacer.Style = ToolBarButtonStyle.Separator;

            ToolBarButton btn = new ToolBarButton();

            btn.ImageIndex  = 0;
            btn.ToolTipText = "New Employee";
            btn.Tag         = 'N';
            tb1.Buttons.Add(btn);

            btn             = new ToolBarButton();
            btn.ImageIndex  = 1;
            btn.ToolTipText = "Save Record";
            btn.Tag         = 'S';
            tb1.Buttons.Add(btn);

            btn             = new ToolBarButton();
            btn.ImageIndex  = 2;
            btn.ToolTipText = "Delete Employee";
            btn.Tag         = 'D';
            tb1.Buttons.Add(btn);
            tb1.Buttons.Add(btnSpacer);

            btn             = new ToolBarButton();
            btn.ImageIndex  = 3;
            btn.ToolTipText = "Previous Record";
            btn.Tag         = 'P';
            tb1.Buttons.Add(btn);

            btn             = new ToolBarButton();
            btn.ImageIndex  = 4;
            btn.ToolTipText = "Next Record";
            btn.Tag         = 'E';
            tb1.Buttons.Add(btn);
            tb1.Buttons.Add(btnSpacer);

            btn             = new ToolBarButton();
            btn.ImageIndex  = 5;
            btn.ToolTipText = "Help";
            btn.Tag         = 'H';
            tb1.Buttons.Add(btn);

            //Set up the list view of employees
            lstEmps.SmallImageList = imgToolBar;
            lstEmps.View           = View.List;

            //Do the buttons
            cmdListByEmp.FlatStyle  = FlatStyle.Popup;
            cmdListByEmp.Height     = txtEmp.Height;
            cmdListByEmp.Top        = txtEmp.Top;
            cmdListByEmp.ImageList  = imgToolBar;
            cmdListByEmp.ImageIndex = 6;
            cmdListByEmp.ImageAlign = ContentAlignment.MiddleCenter;
            cmdListByEmp.Tag        = true;
            cmdListByEmp.Click     += new EventHandler(this.CallEmployees);

            cmdListByNum.FlatStyle  = FlatStyle.Popup;
            cmdListByNum.Height     = txtNum.Height;
            cmdListByNum.Top        = txtNum.Top;
            cmdListByNum.ImageList  = imgToolBar;
            cmdListByNum.ImageIndex = 6;
            cmdListByNum.ImageAlign = ContentAlignment.MiddleCenter;
            cmdListByNum.Tag        = false;
            cmdListByNum.Click     += new EventHandler(this.CallEmployees);

            //Do the status bar
            StatusBarPanel sb = new StatusBarPanel();

            sb.AutoSize    = StatusBarPanelAutoSize.Spring;
            sb.BorderStyle = StatusBarPanelBorderStyle.Sunken;
            sb.Text        = "Employee:";
            sb1.Panels.Add(sb);

            sb          = new StatusBarPanel();
            sb.AutoSize = StatusBarPanelAutoSize.Contents;
            sb.Text     = DateTime.Today.ToLongDateString();
            sb1.Panels.Add(sb);
            sb1.ShowPanels = true;

            txtEmp.ReadOnly = true;
            txtNum.ReadOnly = true;

            dtHire.Format        = DateTimePickerFormat.Short;
            dtHire.MaxDate       = DateTime.Today;
            dtHire.ValueChanged += new EventHandler(this.CalcTime);

            //Do the tabindexes on the form itself
            txtEmp.TabIndex       = 0;
            cmdListByEmp.TabIndex = 1;
            txtNum.TabIndex       = 2;
            cmdListByNum.TabIndex = 3;
            cmdEdit.TabIndex      = 4;
            tc1.TabIndex          = 5; //Doing this starts the tabbing on the tab page
            cmdOK.TabIndex        = 6;
            cmdCancel.TabIndex    = 7;
            cmdHelp.TabIndex      = 8;
            //Do the tabindexes on the first tab page
            txtLast.TabIndex  = 0;
            txtFirst.TabIndex = 1;
            txtMI.TabIndex    = 2;
            dtHire.TabIndex   = 3;
            txtDept.TabIndex  = 4;
            //Do the tabindexes on the second tab page
            cmbPay.TabIndex     = 0;
            chkManager.TabIndex = 1;
            optHourly.TabIndex  = 2;
            optSalary.TabIndex  = 3;
            lstEmps.TabIndex    = 4;
            //Do the tabindexes on the third tab page
            dtBirthday.TabIndex = 0;
            txtCar1.TabIndex    = 1;
            txtLic1.TabIndex    = 2;
            txtCar2.TabIndex    = 3;
            txtLic2.TabIndex    = 4;
            cmbParking.TabIndex = 5;
        }
Esempio n. 29
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);
	}
        internal static void UpdateIsInOverflow(DependencyObject element)
        {
            bool value = ToolBar.GetIsOverflowItem(element) || ToolBar.GetOverflowMode(element) == OverflowMode.Always;

            element.SetValue(IsInOverflowPropertyKey, value);
        }
Esempio n. 31
0
 private void InitializeComponent()
 {
     this.components  = new Container();
     this.tbToolPanel = new ToolBar();
     this.ilTools     = new ImageList(this.components);
     this.pnDefault   = new Panel();
     this.label1      = new Label();
     this.pnColor     = new Panel();
     this.ddlStyle    = new ComboBox();
     this.lStyle      = new Label();
     this.lPenWidth   = new Label();
     this.ddlPenWidth = new ComboBox();
     this.cdPen       = new ColorDialog();
     this.pnDefault.SuspendLayout();
     base.SuspendLayout();
     this.tbToolPanel.AllowDrop      = true;
     this.tbToolPanel.ButtonSize     = new Size(0x18, 0x18);
     this.tbToolPanel.Divider        = false;
     this.tbToolPanel.DropDownArrows = true;
     this.tbToolPanel.ImageList      = this.ilTools;
     this.tbToolPanel.Location       = new Point(0, 0);
     this.tbToolPanel.Name           = "tbToolPanel";
     this.tbToolPanel.ShowToolTips   = true;
     this.tbToolPanel.Size           = new Size(0x60, 0x1c);
     this.tbToolPanel.TabIndex       = 0;
     this.tbToolPanel.ButtonClick   += new ToolBarButtonClickEventHandler(this.tbToolPanel_ButtonClick);
     this.ilTools.ImageSize          = new Size(20, 20);
     this.ilTools.TransparentColor   = Color.Transparent;
     this.pnDefault.Controls.Add(this.label1);
     this.pnDefault.Controls.Add(this.pnColor);
     this.pnDefault.Controls.Add(this.ddlStyle);
     this.pnDefault.Controls.Add(this.lStyle);
     this.pnDefault.Controls.Add(this.lPenWidth);
     this.pnDefault.Controls.Add(this.ddlPenWidth);
     this.pnDefault.Dock         = DockStyle.Bottom;
     this.pnDefault.Location     = new Point(0, 0x108);
     this.pnDefault.Name         = "pnDefault";
     this.pnDefault.Size         = new Size(0x60, 0xb0);
     this.pnDefault.TabIndex     = 1;
     this.label1.Location        = new Point(8, 0x10);
     this.label1.Name            = "label1";
     this.label1.Size            = new Size(80, 0x10);
     this.label1.TabIndex        = 6;
     this.label1.Text            = "Default Pen:";
     this.pnColor.BackColor      = Color.Black;
     this.pnColor.BorderStyle    = BorderStyle.Fixed3D;
     this.pnColor.Location       = new Point(40, 0x90);
     this.pnColor.Name           = "pnColor";
     this.pnColor.Size           = new Size(0x18, 0x18);
     this.pnColor.TabIndex       = 5;
     this.pnColor.Click         += new EventHandler(this.pnColor_Click);
     this.ddlStyle.DropDownStyle = ComboBoxStyle.DropDownList;
     this.ddlStyle.Location      = new Point(8, 0x74);
     this.ddlStyle.Name          = "ddlStyle";
     this.ddlStyle.Size          = new Size(0x38, 20);
     this.ddlStyle.TabIndex      = 3;
     this.lStyle.AutoSize        = true;
     this.lStyle.Location        = new Point(7, 0x60);
     this.lStyle.Name            = "lStyle";
     this.lStyle.Size            = new Size(0x2a, 0x11);
     this.lStyle.TabIndex        = 2;
     this.lStyle.Text            = "Style:";
     this.lPenWidth.AutoSize     = true;
     this.lPenWidth.Location     = new Point(7, 0x30);
     this.lPenWidth.Name         = "lPenWidth";
     this.lPenWidth.Size         = new Size(0x2a, 0x11);
     this.lPenWidth.TabIndex     = 1;
     this.lPenWidth.Text         = "Width:";
     this.ddlPenWidth.Items.AddRange(new object[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" });
     this.ddlPenWidth.Location = new Point(8, 0x41);
     this.ddlPenWidth.Name     = "ddlPenWidth";
     this.ddlPenWidth.Size     = new Size(0x38, 20);
     this.ddlPenWidth.TabIndex = 0;
     this.ddlPenWidth.Text     = "1";
     base.Controls.Add(this.pnDefault);
     base.Controls.Add(this.tbToolPanel);
     base.Name = "ObjectToolPanel";
     base.Size = new Size(0x60, 440);
     this.pnDefault.ResumeLayout(false);
     base.ResumeLayout(false);
 }
Esempio n. 32
0
		protected virtual void Decorate(ToolBar toolbar)
		{			
			Corner corner = AllCorners;
			if (toolbar.Pane != null && toolbar.Pane is AnchorPane) // the toolbar is anchored
			{
				var location = (toolbar.Pane as AnchorPane).Location;
				switch (location)
				{
				case AnchorLocation.N:
					corner = Corner.SE | Corner.SW;
					break;
				case AnchorLocation.E:
					corner = Corner.NW | Corner.SW;
					break;
				case AnchorLocation.S:
					corner = Corner.NW | Corner.NE;
					break;
				case AnchorLocation.W:
					corner = Corner.NE | Corner.SE;
					break;					
				}
				FillRectangle(Coord.Zeros, toolbar.RenderSize, corner, FillType.Background, toolbar.HitState, location);
			}
			else if (toolbar.ParentControl != null && toolbar.ParentControl is IOrientable) // it belongs to something that has an orientation, like a stack
			{
				AnchorLocation location = AnchorLocation.E;
				if ((toolbar.ParentControl as IOrientable).Orientation == Orientation.Horizontal)
					location = AnchorLocation.S;			
				FillRectangle(Coord.Zeros, toolbar.RenderSize, Corner.None, FillType.Background, toolbar.HitState, location);
			}
			else // the toolbar is not anchored
			{
				FillRectangle(Coord.Zeros, toolbar.RenderSize, AllCorners, FillType.Background, toolbar.HitState, DefaultBackgroundLocation);
			}
		}
Esempio n. 33
0
        public MainForm()
        {
            start = new StartDialog();
            start.ShowModal(this);
            //Show the login dialog as long as the user authentication fails
            while (start.LoginCheck == false)
            {
                MessageBox.Show(this, "Wrong Name/Password. Try again.");
                start.ShowModal(this);
            }

            if (start.GetWallets.Count > 0)
            {
                wallets = start.GetWallets;
            }
            else
            {
                wallets = new List <Wallet>();
            }

            //Create a Grid View from a list of wallets
            var grid = new GridView {
                DataStore = wallets
            };

            grid.GridLines = GridLines.Both;
            //Adding columns to a grid view and binding data to them
            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <Wallet, string>(r => r.Name)
                },
                HeaderText = "Name"
            });

            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <Wallet, string>(r => r.CryptocurrencyName)
                },
                HeaderText = "Cryptocurrency"
            });

            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <Wallet, string>(r => r.Address)
                },
                HeaderText = "Address"
            });

            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <Wallet, string>(r => r.PublicKey)
                },
                HeaderText = "Public Key"
            });

            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <Wallet, string>(r => r.PrivateKey)
                },
                HeaderText = "Private Key"
            });

            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <Wallet, string>(r => r.PassPhrase)
                },
                HeaderText = "Pass Phrase"
            });

            grid.Columns.Add(new GridColumn
            {
                DataCell = new TextBoxCell {
                    Binding = Binding.Property <Wallet, string>(r => r.WordCode)
                },
                HeaderText = "Word Code"
            });


            Title      = "Cryptocompanion";
            ClientSize = new Size(550, 400);

            Content = grid;

            //Adding new wallet info capability
            var AddCommand = new Command {
                MenuText = "Add...", ToolBarText = "Add..."
            };

            AddCommand.Executed += (sender, e) =>
            {
                AddDialog add = new AddDialog();
                add.ShowModal(this);
                Wallet wallet = new Wallet
                {
                    Name               = add.AddName,
                    Address            = add.AddAddress,
                    CryptocurrencyName = add.AddCryptocurrencyName,
                    PassPhrase         = add.AddPassPhrase,
                    PrivateKey         = add.AddPrivateKey,
                    PublicKey          = add.AddPublicKey,
                    WordCode           = add.AddWordCode
                };
                wallets.Add(wallet);
                grid.DataStore = wallets;
            };
            //Open other file supported by program
            var OpenCommand = new Command {
                MenuText = "Open...", ToolBarText = "Open..."
            };

            OpenCommand.Executed += (sender, e) =>
            {
                start.GetWallets.Clear();
                start.DefaultButton.PerformClick();
                if (start.GetWallets.Count > 0)
                {
                    wallets = start.GetWallets;
                }
                else
                {
                    wallets = new List <Wallet>();
                }
                grid.DataStore = wallets;
                start.Close();
            };
            //Save current data to  specified file
            var SaveCommand = new Command {
                MenuText = "Save...", ToolBarText = "Save..."
            };

            SaveCommand.Executed += (sender, e) =>
            {
                SaveFileDialog saveFile = new SaveFileDialog();
                if (saveFile.ShowDialog(this) == DialogResult.Ok)
                {
                    string fileName = saveFile.FileName;

                    string encRecoveryCode = Cryptography.Encrypt(start.user.RecoveryCode, start.PassPhrase);
                    string encFirstName    = Cryptography.Encrypt(start.user.FirstName, start.PassPhrase);
                    string encLastName     = Cryptography.Encrypt(start.user.LastName, start.PassPhrase);
                    string encPassword     = Cryptography.Encrypt(start.user.Password, start.PassPhrase);

                    System.IO.File.WriteAllText(fileName, (start.PassPhrase + "-"));
                    System.IO.File.AppendAllText(fileName, (encFirstName + "-"));
                    System.IO.File.AppendAllText(fileName, (encLastName + "-"));
                    System.IO.File.AppendAllText(fileName, (encPassword + "-"));
                    System.IO.File.AppendAllText(fileName, (encRecoveryCode + "-"));

                    foreach (var item in wallets)
                    {
                        //Encrypting and saving every wallet in list of wallets
                        string encItemName               = Cryptography.Encrypt(item.Name, start.PassPhrase);
                        string encItemAddress            = Cryptography.Encrypt(item.Address, start.PassPhrase);
                        string encItemCryptocurrencyName = Cryptography.Encrypt(item.CryptocurrencyName, start.PassPhrase);
                        string encItemPassPhrase         = Cryptography.Encrypt(item.PassPhrase, start.PassPhrase);
                        string encItemWordCode           = Cryptography.Encrypt(item.WordCode, start.PassPhrase);
                        string encItemPublicKey          = Cryptography.Encrypt(item.PublicKey, start.PassPhrase);
                        string encItemPrivateKey         = Cryptography.Encrypt(item.PrivateKey, start.PassPhrase);

                        System.IO.File.AppendAllText(fileName, (encItemName + "_"));
                        System.IO.File.AppendAllText(fileName, (encItemAddress + "_"));
                        System.IO.File.AppendAllText(fileName, (encItemCryptocurrencyName + "_"));
                        System.IO.File.AppendAllText(fileName, (encItemPassPhrase + "_"));
                        System.IO.File.AppendAllText(fileName, (encItemWordCode + "_"));
                        System.IO.File.AppendAllText(fileName, (encItemPublicKey + "_"));
                        System.IO.File.AppendAllText(fileName, (encItemPrivateKey + "*"));
                    }

                    MessageBox.Show(this, "File saved successfully!");
                }
            };
            //Delete wallet object
            var DeleteCommand = new Command {
                MenuText = "Delete...", ToolBarText = "Delete..."
            };

            DeleteCommand.Executed += (sender, e) =>
            {
                var row = grid.SelectedRow;
                //SelectedRow returns -1 when nothing is selected
                if (row != -1)
                {
                    wallets.RemoveAt(row);
                    grid.DataStore = wallets;
                }
                else
                {
                    MessageBox.Show(this, "No items selected to delete");
                }
            };
            //Edit wallet info
            //Program displays add dialog with wallet data that is currently specified and then saves changes if any are done
            var EditCommand = new Command {
                MenuText = "Edit...", ToolBarText = "Edit..."
            };

            EditCommand.Executed += (sender, e) =>
            {
                var row = grid.SelectedRow;
                if (row != -1)
                {
                    AddDialog add = new AddDialog
                    {
                        AddName               = wallets[row].Name,
                        AddAddress            = wallets[row].Address,
                        AddWordCode           = wallets[row].WordCode,
                        AddPublicKey          = wallets[row].PublicKey,
                        AddPassPhrase         = wallets[row].PassPhrase,
                        AddPrivateKey         = wallets[row].PrivateKey,
                        AddCryptocurrencyName = wallets[row].CryptocurrencyName,
                    };
                    add.ShowModal(this);
                    wallets[row].Name               = add.AddName;
                    wallets[row].Address            = add.AddAddress;
                    wallets[row].WordCode           = add.AddWordCode;
                    wallets[row].PublicKey          = add.AddPublicKey;
                    wallets[row].PassPhrase         = add.AddPassPhrase;
                    wallets[row].PrivateKey         = add.AddPrivateKey;
                    wallets[row].CryptocurrencyName = add.AddCryptocurrencyName;
                    grid.DataStore = wallets;
                }
                else
                {
                    MessageBox.Show(this, "No items selected to edit");
                }
            };
            //Passowrd changing capability
            //User can change his password after entering a recovery code that is generated at the registration point
            var ChangePasswordCommand = new Command {
                MenuText = "Change Password", ToolBarText = "Change Password"
            };

            ChangePasswordCommand.Executed += (sender, e) =>
            {
                ChangePasswordDialog change = new ChangePasswordDialog();
                change.ShowModal(this);
                if (change.RecoveryCodeCheck == start.user.RecoveryCode)
                {
                    start.user.Password = change.ChangedPassword;
                    MessageBox.Show(this, "Password changed successfully!");
                }
            };
            //Closes the application
            var quitCommand = new Command {
                MenuText = "Quit", Shortcut = Application.Instance.CommonModifier | Keys.Q
            };

            quitCommand.Executed += (sender, e) => Application.Instance.Quit();


            // create menu
            Menu = new MenuBar
            {
                Items =
                {
                    // File submenu
                    new ButtonMenuItem {
                        Text = "&File", Items ={ OpenCommand,          ChangePasswordCommand, SaveCommand   }
                    },
                    new ButtonMenuItem {
                        Text = "&Edit", Items ={ AddCommand,           EditCommand,           DeleteCommand }
                    },
                },
                ApplicationItems =
                {
                    // application (OS X) or file menu (others)
                    new ButtonMenuItem {
                        Text = "&Preferences..."
                    },
                },
                QuitItem = quitCommand,
            };

            // create toolbar
            ToolBar = new ToolBar {
                Items = { OpenCommand, AddCommand, DeleteCommand, EditCommand, SaveCommand }
            };
        }
Esempio n. 34
0
	public MainForm ()
	{
		SuspendLayout ();
		// 
		// _toolBar
		// 
		_toolBar = new ToolBar ();
		_toolBar.Appearance = ToolBarAppearance.Flat;
		_toolBar.BorderStyle = BorderStyle.FixedSingle;
		_toolBar.Dock = DockStyle.Top;
		_toolBar.DropDownArrows = true;
		_toolBar.ShowToolTips = true;
		_toolBar.Height = 43;
		_toolBar.TabIndex = 0;
		// 
		// _toolBarButton
		// 
		_toolBarButton = new ToolBarButton ();
		_toolBarButton.Text = "Should be orange";
		_toolBar.Buttons.Add (_toolBarButton);
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The ToolBar is orange.{0}{0}" +
			"2. There is no gap between the ToolBar and the TabControl.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// _bugDescriptionText2
		// 
		_bugDescriptionText2 = new TextBox ();
		_bugDescriptionText2.Multiline = true;
		_bugDescriptionText2.Dock = DockStyle.Fill;
		_bugDescriptionText2.Text = string.Format (CultureInfo.InvariantCulture,
			"Steps to execute:{0}{0}" +
			"1. Click the \"Should be orange\" button.{0}{0}" +
			"Expected result:{0}{0}" +
			"1. No artifact (line) is left behind after releasing the button.",
			Environment.NewLine);
		// 
		// _tabPage2
		// 
		_tabPage2 = new TabPage ();
		_tabPage2.Text = "#2";
		_tabPage2.Controls.Add (_bugDescriptionText2);
		_tabControl.Controls.Add (_tabPage2);
		// 
		// MainForm
		// 
		AutoScaleBaseSize = new Size (5, 13);
		BackColor = Color.OrangeRed;
		ClientSize = new Size (300, 180);
		Controls.Add (_tabControl);
		Controls.Add (_toolBar);
		StartPosition = FormStartPosition.CenterScreen;
		Text = "bug #80196";
		ResumeLayout (false);
	}
Esempio n. 35
0
        public MainForm()
        {
            model = new MainFormVM();

            DataContext = model;


            Title      = "Gtk Leak Test App";
            ClientSize = new Size(1200, 700);
            var newfont = new Font(FontFamilies.SansFamilyName, 12);

            Labels = new DropShadowLabel[16];
            for (int i = 0; i < Labels.Length; i++)
            {
                Labels[i]           = new DropShadowLabel(model.Labels[i]);
                Labels[i].Font      = newfont;
                Labels[i].TextAlign = ContentAlignment.MiddleCenter;
                Labels[i].Size      = new Size(56, LabelHeight);
            }


            var LeftBar = new PlainVerticalBar(model.LeftBar);

            LeftBar.Size = new Size(71, 224);

            var MiddleBar = new PlainVerticalBar(model.MiddleBar);

            MiddleBar.Size = new Size(71, 224);

            var RightBar = new PlainVerticalBar(model.RightBar);

            RightBar.Size = new Size(71, 224);

            var Pump = new PlainVerticalBar(model.Pump);

            Pump.Size = new Size(71, 224);

            // for GC/Process memory
            meminfo = new Label {
                Font = newfont, TextColor = Colors.White
            };


            var displayarea = new TableLayout
            {
                BackgroundColor = Colors.DarkBlue,
                Spacing         = new Size(2, 2),
                Rows            =
                {
                    new TableRow
                    {
                        ScaleHeight = true,
                        Cells       =
                        {
                            new TableCell(Labels[0], true),
                            new TableCell(Labels[1], true),
                            new TableCell(Labels[2], true),
                            new TableCell(Labels[3], true),
                        }
                    },
                    new TableRow
                    {
                        ScaleHeight = true,
                        Cells       =
                        {
                            new TableCell(Labels[4], true),
                            new TableCell(Labels[5], true),
                            new TableCell(Labels[6], true),
                            new TableCell(Labels[7], true),
                        }
                    },
                    new TableRow
                    {
                        ScaleHeight = true,
                        Cells       =
                        {
                            new TableCell(Labels[8],  true),
                            new TableCell(Labels[9],  true),
                            new TableCell(Labels[10], true),
                            new TableCell(Labels[11], true),
                        }
                    },
                    new TableRow
                    {
                        ScaleHeight = true,
                        Cells       =
                        {
                            new TableCell(Labels[12], true),
                            new TableCell(Labels[13], true),
                            new TableCell(Labels[14], true),
                            new TableCell(Labels[15], true),
                        }
                    },
                    new TableRow
                    {
                        ScaleHeight = false,
                        Cells       =
                        {
                            new TableCell(LeftBar,   false),
                            new TableCell(MiddleBar, false),
                            new TableCell(RightBar,  false),
                            new TableCell(Pump,      false),
                        }
                    },
                }
            };



            Content = new TableLayout
            {
                BackgroundColor = Colors.RoyalBlue,
                //Size = new Size(ClientSize.Width - 1, 20),
                Spacing = new Size(2, 2),
                Rows    =
                {
                    displayarea,
                    meminfo
                }
            };

            // create a few commands that can be used for the menu and toolbar
            var startstop = new Command {
                MenuText = "Start/Stop", ToolBarText = "Start/Stop"
            };

            startstop.Executed += (sender, e) => model.ToggleUpdate();

            var pause = new Command {
                MenuText = "Toggle Update", ToolBarText = "Toggle Update"
            };

            pause.Executed += (sender, e) => model.PauseUpdate();

            // create toolbar
            ToolBar = new ToolBar {
                Items = { startstop, pause }
            };

            GetInitialMemory();

            mem_update = new Timer(UpdateMemField, null, 0, 2000);
        }
Esempio n. 36
0
        public void TestToolBar()
        {
            ToolBar bar = new ToolBar("newBar");

            Assert.AreEqual("newBar", bar.Name);
            Assert.AreEqual(String.Empty, bar.Text);
            Assert.IsTrue(bar is Component);

            ToolBar anotherBar = new ToolBar("anotherBar", "someText");
            Assert.AreEqual("someText", anotherBar.Text);
            Assert.AreEqual("anotherBar", anotherBar.Name);

            Assert.AreEqual("toolBar", anotherBar.Type);
            Assert.AreEqual("toolBar(\"anotherBar\")", anotherBar.GetBaseComponentString());
            Assert.AreEqual("getTestFixture().toolBar(\"anotherBar\")", anotherBar.GetQueryString());
            Assert.AreEqual("getTestFixture().prefix(\"prefix\").toolBar(\"anotherBar\")", anotherBar.GetQueryString("prefix(\"prefix\")"));
        }
Esempio n. 37
0
        void CreateMenuToolBar()
        {
            var about = new Commands.About();
            var quit  = new Commands.Quit();

            if (Platform.Supports <MenuBar>())
            {
                var fileCommand = new Command {
                    MenuText = "File Command", Shortcut = Application.Instance.CommonModifier | Keys.F
                };
                fileCommand.Executed += (sender, e) => Log.Write(sender, "Executed");
                var editCommand = new Command {
                    MenuText = "Edit Command", Shortcut = Keys.Shift | Keys.E
                };
                editCommand.Executed += (sender, e) => Log.Write(sender, "Executed");
                var viewCommand = new Command {
                    MenuText = "View Command", Shortcut = Keys.Control | Keys.V
                };
                viewCommand.Executed += (sender, e) => Log.Write(sender, "Executed");
                var windowCommand = new Command {
                    MenuText = "Window Command"
                };
                windowCommand.Executed += (sender, e) => Log.Write(sender, "Executed");

                var file = new ButtonMenuItem {
                    Text = "&File", Items = { fileCommand }
                };
                var edit = new ButtonMenuItem {
                    Text = "&Edit", Items = { editCommand }
                };
                var view = new ButtonMenuItem {
                    Text = "&View", Items = { viewCommand }
                };
                var window = new ButtonMenuItem {
                    Text = "&Window", Order = 1000, Items = { windowCommand }
                };

                if (Platform.Supports <CheckMenuItem>())
                {
                    edit.Items.AddSeparator();

                    var checkMenuItem1 = new CheckMenuItem {
                        Text = "Check Menu Item", Shortcut = Keys.Shift | Keys.K
                    };
                    checkMenuItem1.Click          += (sender, e) => Log.Write(checkMenuItem1, "Click, {0}, Checked: {1}", checkMenuItem1.Text, checkMenuItem1.Checked);
                    checkMenuItem1.CheckedChanged += (sender, e) => Log.Write(checkMenuItem1, "CheckedChanged, {0}: {1}", checkMenuItem1.Text, checkMenuItem1.Checked);
                    edit.Items.Add(checkMenuItem1);

                    var checkMenuItem2 = new CheckMenuItem {
                        Text = "Initially Checked Menu Item", Checked = true
                    };
                    checkMenuItem2.Click          += (sender, e) => Log.Write(checkMenuItem2, "Click, {0}, Checked: {1}", checkMenuItem2.Text, checkMenuItem2.Checked);
                    checkMenuItem2.CheckedChanged += (sender, e) => Log.Write(checkMenuItem2, "CheckedChanged, {0}: {1}", checkMenuItem2.Text, checkMenuItem2.Checked);
                    edit.Items.Add(checkMenuItem2);
                }

                if (Platform.Supports <RadioMenuItem>())
                {
                    edit.Items.AddSeparator();

                    RadioMenuItem controller = null;
                    for (int i = 0; i < 5; i++)
                    {
                        var radio = new RadioMenuItem(controller)
                        {
                            Text = "Radio Menu Item " + (i + 1)
                        };
                        radio.Click          += (sender, e) => Log.Write(radio, "Click, {0}, Checked: {1}", radio.Text, radio.Checked);
                        radio.CheckedChanged += (sender, e) => Log.Write(radio, "CheckedChanged, {0}: {1}", radio.Text, radio.Checked);
                        edit.Items.Add(radio);

                        if (controller == null)
                        {
                            radio.Checked = true;                             // check the first item initially
                            controller    = radio;
                        }
                    }
                }

                Menu = new MenuBar
                {
                    Items =
                    {
                        // custom top-level menu items
                        file, edit, view, window
                    },
                    ApplicationItems =
                    {
                        // custom menu items for the application menu (Application on OS X, File on others)
                        new Command        {
                            MenuText = "Application command"
                        },
                        new ButtonMenuItem {
                            Text = "Application menu item"
                        }
                    },
                    HelpItems =
                    {
                        new Command {
                            MenuText = "Help Command"
                        }
                    },
                    QuitItem  = quit,
                    AboutItem = about
                };
            }

            if (Platform.Supports <ToolBar>())
            {
                // create and set the toolbar
                ToolBar = new ToolBar();

                ToolBar.Items.Add(about);
                if (Platform.Supports <CheckToolItem>())
                {
                    ToolBar.Items.Add(new SeparatorToolItem {
                        Type = SeparatorToolItemType.Divider
                    });
                    ToolBar.Items.Add(new CheckToolItem {
                        Text = "Check", Image = TestIcons.TestImage
                    });
                }
                if (Platform.Supports <RadioToolItem>())
                {
                    ToolBar.Items.Add(new SeparatorToolItem {
                        Type = SeparatorToolItemType.FlexibleSpace
                    });
                    ToolBar.Items.Add(new RadioToolItem {
                        Text = "Radio1", Image = TestIcons.TestIcon, Checked = true
                    });
                    ToolBar.Items.Add(new RadioToolItem {
                        Text = "Radio2", Image = TestIcons.TestImage
                    });
                }
                ;
            }
        }
Esempio n. 38
0
        private void InitializeComponent()
        {
            SuspendLayout();

            tbImageSave        = new ButtonToolItem();
            tbImageSave.Click += tbImageSave_Click;

            tbGens = new ButtonToolItem();
            //tbGens.DropDown = MenuGens;
            tbGens.Text   = "tbGens";
            tbGens.Click += (sender, e) => MenuGens.Show(this);

            tbModes = new ButtonToolItem();
            //tbModes.DropDown = MenuModes;
            tbModes.Click += (sender, e) => MenuModes.Show(this);

            tbFilter        = new ButtonToolItem();
            tbFilter.Click += ToolBar1_ButtonClick;

            tbPrev         = new ButtonToolItem();
            tbPrev.Enabled = false;
            tbPrev.Click  += ToolBar1_ButtonClick;

            tbNext         = new ButtonToolItem();
            tbNext.Enabled = false;
            tbNext.Click  += ToolBar1_ButtonClick;

            tbDocPreview        = new ButtonToolItem();
            tbDocPreview.Click += tbDocPreview_Click;

            tbDocPrint        = new ButtonToolItem();
            tbDocPrint.Click += tbDocPrint_Click;

            tbOptions        = new ButtonToolItem();
            tbOptions.Click += tbOptions_Click;

            ToolBar1           = new ToolBar();
            ToolBar1.TextAlign = ToolBarTextAlign.Right;
            ToolBar1.Items.AddRange(new ToolItem[] {
                tbImageSave,
                new SeparatorToolItem(),
                tbGens,
                new SeparatorToolItem(),
                tbModes,
                new SeparatorToolItem(),
                tbFilter,
                tbPrev,
                tbNext,
                new SeparatorToolItem(),
                tbDocPreview,
                tbDocPrint,
                new SeparatorToolItem(),
                tbOptions
            });

            miGensInf         = new RadioMenuItem();
            miGensInf.Checked = true;
            miGensInf.Text    = "Inf";
            miGensInf.Click  += miGens9_Click;

            miGens1        = new RadioMenuItem();
            miGens1.Text   = "1";
            miGens1.Click += miGens9_Click;

            miGens2        = new RadioMenuItem();
            miGens2.Text   = "2";
            miGens2.Click += miGens9_Click;

            miGens3        = new RadioMenuItem();
            miGens3.Text   = "3";
            miGens3.Click += miGens9_Click;

            miGens4        = new RadioMenuItem();
            miGens4.Text   = "4";
            miGens4.Click += miGens9_Click;

            miGens5        = new RadioMenuItem();
            miGens5.Text   = "5";
            miGens5.Click += miGens9_Click;

            miGens6        = new RadioMenuItem();
            miGens6.Text   = "6";
            miGens6.Click += miGens9_Click;

            miGens7        = new RadioMenuItem();
            miGens7.Text   = "7";
            miGens7.Click += miGens9_Click;

            miGens8        = new RadioMenuItem();
            miGens8.Text   = "8";
            miGens8.Click += miGens9_Click;

            miGens9        = new RadioMenuItem();
            miGens9.Text   = "9";
            miGens9.Click += miGens9_Click;

            MenuGens = new ContextMenu();
            MenuGens.Items.AddRange(new MenuItem[] {
                miGensInf,
                miGens1,
                miGens2,
                miGens3,
                miGens4,
                miGens5,
                miGens6,
                miGens7,
                miGens8,
                miGens9
            });

            miModeBoth        = new RadioMenuItem();
            miModeBoth.Text   = "miModeBoth";
            miModeBoth.Click += miModeItem_Click;

            miModeAncestors        = new RadioMenuItem();
            miModeAncestors.Text   = "miModeAncestors";
            miModeAncestors.Click += miModeItem_Click;

            miModeDescendants        = new RadioMenuItem();
            miModeDescendants.Text   = "miModeDescendants";
            miModeDescendants.Click += miModeItem_Click;

            miTraceSelected        = new CheckMenuItem();
            miTraceSelected.Text   = "miTraceSelected";
            miTraceSelected.Click += miTraceSelected_Click;

            miTraceKinships        = new CheckMenuItem();
            miTraceKinships.Text   = "miTraceKinships";
            miTraceKinships.Click += miTraceKinships_Click;

            miCertaintyIndex        = new CheckMenuItem();
            miCertaintyIndex.Text   = "miCertaintyIndex";
            miCertaintyIndex.Click += miCertaintyIndex_Click;

            miFillColor        = new ButtonMenuItem();
            miFillColor.Text   = "miFillColor";
            miFillColor.Click += miFillColor_Click;

            miFillImage        = new ButtonMenuItem();
            miFillImage.Text   = "miFillImage";
            miFillImage.Click += miFillImage_Click;

            MenuModes = new ContextMenu();
            MenuModes.Items.AddRange(new MenuItem[] {
                miModeBoth,
                miModeAncestors,
                miModeDescendants,
                new SeparatorMenuItem(),
                miTraceSelected,
                miTraceKinships,
                miCertaintyIndex,
                new SeparatorMenuItem(),
                miFillColor,
                miFillImage,
                new SeparatorMenuItem()
            });

            miEdit        = new ButtonMenuItem();
            miEdit.Text   = "miEdit";
            miEdit.Click += miEdit_Click;

            miFatherAdd        = new ButtonMenuItem();
            miFatherAdd.Text   = "miFatherAdd";
            miFatherAdd.Click += miFatherAdd_Click;

            miMotherAdd        = new ButtonMenuItem();
            miMotherAdd.Text   = "miMotherAdd";
            miMotherAdd.Click += miMotherAdd_Click;

            miFamilyAdd        = new ButtonMenuItem();
            miFamilyAdd.Text   = "miFamilyAdd";
            miFamilyAdd.Click += miFamilyAdd_Click;

            miSpouseAdd        = new ButtonMenuItem();
            miSpouseAdd.Text   = "miSpouseAdd";
            miSpouseAdd.Click += miSpouseAdd_Click;

            miSonAdd        = new ButtonMenuItem();
            miSonAdd.Text   = "miSonAdd";
            miSonAdd.Click += miSonAdd_Click;

            miDaughterAdd        = new ButtonMenuItem();
            miDaughterAdd.Text   = "miDaughterAdd";
            miDaughterAdd.Click += miDaughterAdd_Click;

            miDelete        = new ButtonMenuItem();
            miDelete.Text   = "miDelete";
            miDelete.Click += miDelete_Click;

            miRebuildTree        = new ButtonMenuItem();
            miRebuildTree.Text   = "miRebuildTree";
            miRebuildTree.Click += miRebuildTree_Click;

            miRebuildKinships        = new ButtonMenuItem();
            miRebuildKinships.Text   = "miRebuildKinships";
            miRebuildKinships.Click += miRebuildKinships_Click;

            miSelectColor        = new ButtonMenuItem();
            miSelectColor.Text   = "miSelectColor";
            miSelectColor.Click += miSelectColor_Click;

            MenuPerson = new ContextMenu();
            MenuPerson.Items.AddRange(new MenuItem[] {
                miEdit,
                new SeparatorMenuItem(),
                miFatherAdd,
                miMotherAdd,
                miFamilyAdd,
                miSpouseAdd,
                miSonAdd,
                miDaughterAdd,
                new SeparatorMenuItem(),
                miDelete,
                new SeparatorMenuItem(),
                miRebuildTree,
                miRebuildKinships,
                new SeparatorMenuItem(),
                miSelectColor
            });
            MenuPerson.Opening += MenuPerson_Opening;


            ShowInTaskbar = true;
            Title         = "TreeChartWin";
            ToolBar       = ToolBar1;
            KeyDown      += TreeChartWin_KeyDown;

            UIHelper.SetPredefProperties(this, 820, 450, true, true);
            ResumeLayout();
        }
Esempio n. 39
0
        void CreateToolbar()
        {
            bar = new ToolBar();
            ImageList       imgList      = new ImageList();
            ResourceManager iconsManager = null;

            iconsManager = new ResourceManager("main.BitmapResources", Assembly.GetEntryAssembly());

            imgList.Images.Add((Bitmap)iconsManager.GetObject("AddButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("SearchButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("ModifyButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("InputButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("OutputButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("DeleteButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("ClearButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("SelectAllButton"));
            imgList.Images.Add((Bitmap)iconsManager.GetObject("StatButton"));

            bar.AutoSize     = true;
            bar.ButtonClick += new ToolBarButtonClickEventHandler(ToolBarButtonClick);

            bar.Appearance = ToolBarAppearance.Flat;
            bar.TextAlign  = ToolBarTextAlign.Right;
            //添加订阅按钮
            ToolBarButton btnAddSubscribe = new ToolBarButton();

            btnAddSubscribe.ImageIndex  = 0;
            btnAddSubscribe.ToolTipText = "添加订阅信息";
            btnAddSubscribe.Text        = "添加";
            //删除订阅按钮
            ToolBarButton btnDeleteSubscribe = new ToolBarButton();

            btnDeleteSubscribe.ImageIndex  = 5;
            btnDeleteSubscribe.ToolTipText = "删除当前的订阅信息";
            btnDeleteSubscribe.Text        = "删除";
            //查询订阅按钮
            ToolBarButton btnSearchSubscribe = new ToolBarButton();

            btnSearchSubscribe.ImageIndex  = 1;
            btnSearchSubscribe.ToolTipText = "按条件查询订阅信息";
            btnSearchSubscribe.Text        = "查询";
            //修改订阅按钮
            ToolBarButton btnModifySubscribe = new ToolBarButton();

            btnModifySubscribe.ImageIndex  = 2;
            btnModifySubscribe.ToolTipText = "修改当前的订阅信息";
            btnModifySubscribe.Text        = "修改";
            //数据导入按钮
            ToolBarButton btnInputSubscribe = new ToolBarButton();

            btnInputSubscribe.ImageIndex  = 3;
            btnInputSubscribe.ToolTipText = "从Excel文件中导入订阅信息";
            btnInputSubscribe.Text        = "导入";
            //数据导出按钮
            ToolBarButton btnOutputSubscribe = new ToolBarButton();

            btnOutputSubscribe.ImageIndex  = 4;
            btnOutputSubscribe.ToolTipText = "将订阅信息导出到Excel文件";
            btnOutputSubscribe.Text        = "导出";

            //隐藏按钮
            ToolBarButton btnClearSubscribe = new ToolBarButton();

            btnClearSubscribe.ImageIndex  = 6;
            btnClearSubscribe.ToolTipText = "隐藏当前显示的记录";
            btnClearSubscribe.Text        = "隐藏";

            //全选按钮
            ToolBarButton btnSelectAllSubscribe = new ToolBarButton();

            btnSelectAllSubscribe.ImageIndex  = 7;
            btnSelectAllSubscribe.ToolTipText = "选中所有的订阅信息";
            btnSelectAllSubscribe.Text        = "全选";

            //统计按钮
            ToolBarButton btnStatSubscribe = new ToolBarButton();

            btnStatSubscribe.ImageIndex  = 8;
            btnStatSubscribe.ToolTipText = "统计符合条件的订阅信息的金额总数及详细情况";
            btnStatSubscribe.Text        = "统计";

            bar.Buttons.AddRange(new ToolBarButton[] { btnAddSubscribe, btnDeleteSubscribe, btnSelectAllSubscribe, btnSearchSubscribe, btnModifySubscribe, btnInputSubscribe, btnOutputSubscribe, btnStatSubscribe, btnClearSubscribe });
            bar.ImageList = imgList;

            this.SuspendLayout();
            this.Controls.Add(bar);
            bar.BringToFront();
            this.ResumeLayout();
        }
Esempio n. 40
0
	public MainForm ()
	{
		ComponentResourceManager resources = new ComponentResourceManager (typeof (MainForm));
		SuspendLayout ();
		// 
		// imgToolMenus
		// 
		imgToolMenus = new ImageList ();
		imgToolMenus.ImageStream = ((ImageListStreamer) (resources.GetObject ("imgToolMenus.ImageStream")));
		imgToolMenus.TransparentColor = Color.Transparent;
		// 
		// _toolBar
		// 
		_toolBar = new ToolBar ();
		_toolBar.Appearance = ToolBarAppearance.Flat;
		_toolBar.DropDownArrows = true;
		_toolBar.ImageList = imgToolMenus;
		_toolBar.Location = new Point (0, 0);
		_toolBar.Name = "_toolBar";
		_toolBar.ShowToolTips = true;
		_toolBar.Size = new Size (690, 28);
		_toolBar.TabIndex = 32;
		_toolBar.TextAlign = ToolBarTextAlign.Right;
		_toolBar.Wrappable = false;
		Controls.Add (_toolBar);
		// 
		// _newButton
		// 
		_newButton = new ToolBarButton ();
		_newButton.ImageIndex = 0;
		_newButton.ToolTipText = "Start a new chess game";
		_toolBar.Buttons.Add (_newButton);
		// 
		// _openButton
		// 
		_openButton = new ToolBarButton ();
		_openButton.ImageIndex = 1;
		_openButton.ToolTipText = "Open a saved chess game";
		_toolBar.Buttons.Add (_openButton);
		// 
		// _moveNowButton
		// 
		_moveNowButton = new ToolBarButton ();
		_moveNowButton.ImageIndex = 11;
		_moveNowButton.Text = "Move Now";
		_moveNowButton.ToolTipText = "Make the computer immediately play the best move it has found so far";
		_toolBar.Buttons.Add (_moveNowButton);
		// 
		// MainForm
		// 
		AutoScaleBaseSize = new Size (5, 13);
		ClientSize = new Size (200, 80);
		Location = new Point (300, 100);
		StartPosition = FormStartPosition.Manual;
		FormBorderStyle = FormBorderStyle.FixedDialog;
		SizeGripStyle = SizeGripStyle.Hide;
		Text = "bug #81733";
		Load += new EventHandler (MainForm_Load);
		ResumeLayout (false);
		PerformLayout ();
	}
Esempio n. 41
0
 internal ToolBarBuilder(HtmlHelper <TModel> htmlHelper, ToolBar toolbar)
     : base(htmlHelper, toolbar)
 {
 }
Esempio n. 42
0
 private void tooBarTop_ItemClicked(object sender, ToolBar.ToolBarItemClickArgs e)
 {
     
     try
     {
         ShowProcess();
       //  ComfirmWindow.ConfirmationBoxs("提示", "测试页面", Utility.GetResourceStr("CONFIRM"), MessageIcon.Question);
         Save();
         
     }
     catch ( Exception ex)
     {
         CommonFunction.ShowErrorMessage(ex.Message);
         CloseProcess();
     }
 }
Esempio n. 43
0
        public MainWindow()
        {
            Title = "Craft the Toolbar";
            // RoutedUICommand는 RoutedCommand를 상속받은 것으로 Text 속성을 갖는다.
            // MenuItem같은 HeaderedItemsControl을 상속받은 객체들이 Command에 RoutedUICommand를 설정하면
            // MenuItem의 Header값으로 RoutedUICommand.Text 값을 사용하게 됩니다.
            RoutedUICommand[] comm =
            {
                ApplicationCommands.New,   ApplicationCommands.Open,
                ApplicationCommands.Save,  ApplicationCommands.Print,
                ApplicationCommands.Cut,   ApplicationCommands.Copy,
                ApplicationCommands.Paste, ApplicationCommands.Delete
            };

            string[] strImages =
            {
                "NewDocumentHS.png", "openHS.png", "saveHS.png",
                "PrintHS.png",       "CutHS.png",  "CopyHS.png",
                "PasteHS.png",       "DeleteHS.png"
            };

            // Window의 Content로 DockPanel을 등록
            DockPanel dock = new DockPanel();

            dock.LastChildFill = false;
            Content            = dock;

            // 툴바를 윈도우의 TOP으로 도킹
            ToolBar toolbar = new ToolBar();

            dock.Children.Add(toolbar);
            DockPanel.SetDock(toolbar, Dock.Top);

            // 툴바 버튼들을 생성
            for (int i = 0; i < 8; i++)
            {
                if (i == 4)
                {
                    toolbar.Items.Add(new Separator());
                }

                // 하나의 버튼을 생성해서 툴바에 추가
                Button btn = new Button();
                btn.Command = comm[i];
                toolbar.Items.Add(btn);

                // 버튼의 Content로써 이미지를 생성
                Image img = new Image();
                img.Source = new BitmapImage(
                    new Uri("pack://application:,,/Images/" + strImages[i]));

                // Fill : 공간에 가득채움, 이미지 왜곡
                // Uniform : 가로세로 비율에 맞게 한쪽 끝이 찰때까지 늘임
                // UniformToFill : 가로세로 비율에 맞게 공간에 찰때까지 계속늘임
                // None : 원래 이미지 대로
                img.Stretch = Stretch.None; //원래의 이미지대로
                btn.Content = img;

                // UICommand의 Text를 기반으로 툴팁 생성
                ToolTip tip = new ToolTip();
                tip.Content = comm[i].Text;
                btn.ToolTip = tip;

                // 윈도우의 CommandBindings에 UIComment를 추가
                // 이벤트핸들러 메소드 추가
                CommandBindings.Add(
                    new CommandBinding(comm[i], ToolBarButtonOnClick));
            }
        }
Esempio n. 44
0
        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;
                    }

                    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;

                    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);
            }
        }
Esempio n. 45
0
        public MainForm()
        {
            Title      = "My Eto Form";
            ClientSize = new Size(400, 350);

            Content = new StackLayout
            {
                Padding = 10,
                Items   =
                {
                    "Hello World!",
                    // add more controls here
                }
            };

            // create a few commands that can be used for the menu and toolbar
            var clickMe = new Command {
                MenuText = "Click Me!", ToolBarText = "Click Me!"
            };

            clickMe.Executed += (sender, e) => MessageBox.Show(this, "I was clicked!");

            var quitCommand = new Command {
                MenuText = "Quit", Shortcut = Application.Instance.CommonModifier | Keys.Q
            };

            quitCommand.Executed += (sender, e) => Application.Instance.Quit();

            var aboutCommand = new Command {
                MenuText = "About..."
            };

            aboutCommand.Executed += (sender, e) => new AboutDialog().ShowDialog(this);

            // create menu
            Menu = new MenuBar
            {
                Items =
                {
                    // File submenu
                    new ButtonMenuItem {
                        Text = "&File", Items ={ clickMe          }
                    },
                    // new ButtonMenuItem { Text = "&Edit", Items = { /* commands/items */ } },
                    // new ButtonMenuItem { Text = "&View", Items = { /* commands/items */ } },
                },
                ApplicationItems =
                {
                    // application (OS X) or file menu (others)
                    new ButtonMenuItem {
                        Text = "&Preferences..."
                    },
                },
                QuitItem  = quitCommand,
                AboutItem = aboutCommand
            };

            // create toolbar
            ToolBar = new ToolBar {
                Items = { clickMe }
            };
        }
Esempio n. 46
0
 public PostBar(ToolBar toolBar)
 {
     InitializeComponent();
     this.toolBar = toolBar;
     this.Width = this.textBox.Width = toolBar.Width;
 }
Esempio n. 47
0
        void tooBarTop_ItemClicked(object sender, ToolBar.ToolBarItemClickArgs e)
        {
            if (this.ADtGrid.SelectedItems.Count == 0)
            {
                CommonFunction.NotifySelection(null);
                return;
            }

            OrderEntity orderEntity = this.ADtGrid.SelectedItem as OrderEntity;
            ShowEditForm(orderEntity, OperationTypes.Browse);
         }
Esempio n. 48
0
    public static void MyToolBarFunc( ToolBar parent )
    {
        parent.Margins = new Size( 2,2 );

        parent.AddTool( (int)MenuIDs.wxID_EXIT, "Exit", MyBitmapsFunc( 0 ), NullObjects.wxNullBitmap, ItemKind.wxITEM_NORMAL, "Exit app", "Exit application", null );
        parent.AddSeparator();
        parent.AddTool( ID_OPEN, "", MyBitmapsFunc( 1 ), NullObjects.wxNullBitmap, ItemKind.wxITEM_NORMAL, "Open", "Open document", null );
        parent.AddTool( (int)MenuIDs.wxID_SAVE, "", MyBitmapsFunc( 5 ), NullObjects.wxNullBitmap, ItemKind.wxITEM_NORMAL, "Save", "Save document", null );
        parent.AddSeparator();
        parent.AddTool( ID_CUT, "Cut", MyBitmapsFunc( 2 ), NullObjects.wxNullBitmap, ItemKind.wxITEM_NORMAL, "Cut", "Move to clipboard", null );
        parent.EnableTool( ID_CUT, false );
        parent.AddTool( ID_COPY, "Copy", MyBitmapsFunc( 3 ), NullObjects.wxNullBitmap, ItemKind.wxITEM_NORMAL, "Copy", "Copy to clipboard", null );
        parent.EnableTool( ID_COPY, false );
        parent.AddTool( ID_PASTE, "Paste", MyBitmapsFunc( 4 ), NullObjects.wxNullBitmap, ItemKind.wxITEM_CHECK, "Paste", "Paste from clipboard", null );
        parent.ToggleTool( ID_PASTE, true );
        parent.AddSeparator();
        string[] strs2 =
        {
            "Times New Roman",
            "Arial",
            "Courier"
        };
        ComboBox item2 = new ComboBox( parent, ID_FONT, "", Window.wxDefaultPosition, new Size(150,-1), strs2, ComboBox.wxCB_DROPDOWN );
        item2.ToolTip ="This is a toolbar control";
        parent.AddControl( item2 );

        parent.Realize();
    }
Esempio n. 49
0
		public ControlsScene(Viewport viewport) : base(viewport)
		{
			Name = "Controls";
			
			// add an ActorInteractor to the viewport
			PrimaryInteractor = new ActorInteractor(this);
			
			
			// load the mwx file
			var mwx = new MwxSource(ResourceHelper.GetStream("demo.mwx"));
			
			
			// northeast buttons
			var cornerButtons = new CornerButtons(Corner.NE);
			//			cornerButtons.Image1 = Image.GetIcon("apply", 22);
			cornerButtons.Action1 += delegate(object sender, EventArgs e) {
				   Console.WriteLine("clicked apply");
			   };
			//			cornerButtons.Image2 = Image.GetIcon("cancel", 22);
			cornerButtons.Action2 += delegate(object sender, EventArgs e) {
				   Console.WriteLine("clicked cancel");
			   };
			var cornerAnchor = new AnchorPane(cornerButtons, AnchorLocation.NE);
			RenderList.AddOverlay(cornerAnchor);
			
			
			// northwest buttons
			cornerButtons = new CornerButtons(Corner.NW);
			//			cornerButtons.Image1 = Image.GetIcon("zoom-in", 22);
			cornerButtons.Action1 += delegate(object sender, EventArgs e) {
				  Console.WriteLine("clicked zoom-in");
			  };
			//			cornerButtons.Image2 = Image.GetIcon("zoom-out", 22);
			cornerButtons.Action2 += delegate(object sender, EventArgs e) {
				  Console.WriteLine("clicked zoom-out");
			  };
			cornerAnchor = new AnchorPane(cornerButtons, AnchorLocation.NW);
			RenderList.AddOverlay(cornerAnchor);
			
			
			// east control stack
			var stack = new Stack();
			stack.Orientation = Orientation.Vertical;
			
			var image = new Image(ResourceHelper.GetStream("plugin.png"));
			//			var image = Image.GetIcon("apply", 48);
			var button = new Button("Apply", image) { ButtonStyle = ButtonStyle.ImageOverLabel };
			button.Clicked += delegate(object sender, EventArgs e) {
				 Console.WriteLine("clicked apply");
			 };
			stack.AddChild(button);
			
			//			image = Image.GetIcon("cancel", 48);
			button = new Button("Cancel", image) { ButtonStyle = ButtonStyle.ImageOverLabel };
			button.Clicked += delegate(object sender, EventArgs e) {
				 Console.WriteLine("clicked cancel");
			 };
			stack.AddChild(button);
			
			var menuBox = new MenuBox();
			menuBox.Parse("One,Two,Three,Four");
			stack.AddChild(menuBox);
			
			var toolAnchor = new AnchorPane(stack, AnchorLocation.E);
			RenderList.AddOverlay(toolAnchor);
			
			
			// the controls dialog
			var controlsDialog = mwx.Get<Dialog>("controls-dialog");
			
			// attach the slider to its value label
			var slider = mwx.Get<Slider>("slider");
			var sliderValue = mwx.Get<Label>("sliderValue");
			sliderValue.Body = slider.Value.ToString("##.##");
			slider.ValueChanged += delegate(object sender, DoubleChangedEvent evt)
			{
				sliderValue.Body = evt.NewValue.ToString("##.##");
			};
			
			// attach the ForceStep checkbox to the slider
			var forceStepCheck = mwx.Get<CheckBox>("forceStepCheck");
			forceStepCheck.CheckChanged += delegate(object sender, BoolChangedEvent evt)
			{
				slider.ForceStep = evt.NewValue;
			};
			
			// floating toolbar
			var toolbar = new ToolBar();
			toolbar.Orientation = Orientation.Vertical;
			toolbar.ButtonStyle = ButtonStyle.ImageNextToLabel;
			
			//			image = Image.GetIcon("controls-dialog", 48);
			button = new Button("General Controls", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(controlsDialog);
			};
			toolbar.AddChild(button);
			
			
			// the progress dialog
			var progressDialog = mwx.Get<Dialog>("progress-dialog");
			
			// attach the slider to the progress bars
			var progressSlider = mwx.Get<Slider>("progressSlider");
			var progressBarH = mwx.Get<ProgressBar>("progressBarH");
			var progressBarV = mwx.Get<ProgressBar>("progressBarV");
			var progressDial = mwx.Get<ProgressDial>("progressDial");
			progressBarH.Value = progressSlider.Value;
			progressBarV.Value = progressSlider.Value;
			progressDial.Value = progressSlider.Value;
			progressSlider.ValueChanged += delegate(object sender, DoubleChangedEvent evt)
			{
				progressBarH.Value = progressSlider.Value;
				progressBarV.Value = progressSlider.Value;
				progressDial.Value = progressSlider.Value;
			};
			
			image = new Image(ResourceHelper.GetStream("radial-progress.png"));
			button = new Button("Progress Indicators", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(progressDialog);
			};
			toolbar.AddChild(button);
			
			// the tree view dialog
			var treeDialog = mwx.Get<Dialog>("tree-dialog");
			
			image = new Image(ResourceHelper.GetStream("view-tree.png"));
			button = new Button("Tree View", image);
			button.Clicked += delegate(object sender, EventArgs e) { 
				ShowModal(treeDialog);
			};
			toolbar.AddChild(button);
			
			var toolActor = new ActorPane(toolbar);
			toolActor.Normal = new Vector(0, -1, 0);
			RenderList.AddActor(toolActor);
			toolActor.ComputeGeometry();
			
			
			// the ring bar
			var ringBar = mwx.Get<RingBar>("ring-bar");
			toolActor = new ActorPane(ringBar);
			toolActor.Normal = new Vector(1, 0, 0);
			toolActor.Origin.Y = -192;
			toolActor.XAxis = new Vector(0, 1, 0);
			RenderList.AddActor(toolActor);
			toolActor.ComputeGeometry();

			mwx.Get<RingButton>("forward-button").Clicked += delegate {
				Console.WriteLine("forward pushed");
			};
			mwx.Get<RingButton>("backward-button").Clicked += delegate {
				Console.WriteLine("backward pushed");
			};
			mwx.Get<RingButton>("play-button").Clicked += delegate {
				Console.WriteLine("play pushed");
			};
			mwx.Get<RingButton>("pause-button").Clicked += delegate {
				Console.WriteLine("pause pushed");
			};


			var sceneInfo = new SceneInfoOverlay(this);
			RenderList.AddOverlay(sceneInfo);

			Camera.SetViewDirection(ViewDirection.Standard);
		}
 // Constructors
 public ToolBarButtonCollection(ToolBar owner)
 {
 }
Esempio n. 51
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);
	}
Esempio n. 52
0
 public void AddToolbar(ToolBar toolBar)
 {
     Control.Controls.Add((swf.Control)toolBar.ControlObject);
 }
Esempio n. 53
0
        void deatilGridBar_ItemClicked(object sender, ToolBar.ToolBarItemClickArgs e)
        {
            if (e.Key == "S1")
            {
                this.SumType = 0;
            }
            else
            {
                this.SumType = 1;
            }
            //this.InitData();
            DetailGrid grid = this.EditForm.FindControl("OrderGrid") as DetailGrid;
            if (grid != null)
            {
                if (this.SumType == 0)
                {
                    int i = 1;
                    if (grid.ADGrid.Columns[0].GetType() == typeof(DataGridIconColumn))
                    {
                        i = 2;
                    }
                    grid.ADGrid.Columns[i-1].Visibility = Visibility.Visible;
                    grid.ADGrid.Columns[i].Visibility = Visibility.Visible;
                    grid.ADGrid.Columns[i + 3].Visibility = Visibility.Visible;

                    grid.ADGrid.Columns[i + 1].Visibility = Visibility.Collapsed;
                    grid.ADGrid.Columns[i + 2].Visibility = Visibility.Collapsed;
                    grid.ADGrid.Columns[i + 4].Visibility = Visibility.Collapsed;
                    grid.ADGrid.Columns[i + 5].Visibility = Visibility.Collapsed;

                    grid.ItemsSource = this.OrderEntity.GetRelationFBEntities(typeof(V_SubjectDepartmentSum).Name);
                }
                else
                {
                    int i = 1;
                    if (grid.ADGrid.Columns[0].GetType() == typeof(DataGridIconColumn))
                    {
                        i = 2;
                    }
                    grid.ADGrid.Columns[i-1].Visibility = Visibility.Collapsed;
                    grid.ADGrid.Columns[i].Visibility = Visibility.Collapsed;

                    grid.ADGrid.Columns[i + 2].Visibility = Visibility.Visible;
                    grid.ADGrid.Columns[i + 1].Visibility = Visibility.Visible;
                    grid.ADGrid.Columns[i + 3].Visibility = Visibility.Visible;
                    grid.ADGrid.Columns[i + 4].Visibility = Visibility.Visible;
                    grid.ADGrid.Columns[i + 5].Visibility = Visibility.Visible;

                    grid.ItemsSource = this.OrderEntity.GetRelationFBEntities(typeof(T_FB_DEPTBUDGETSUMDETAIL).Name);
                }
            }
        }
Esempio n. 54
0
 public void RemoveToolbar(ToolBar toolBar)
 {
     Control.Controls.Remove((swf.Control)toolBar.ControlObject);
 }
Esempio n. 55
0
		WPFToolbar (ToolBar toolbar) : base (toolbar)
		{
			this.toolbar = toolbar;

			toolbar.ConfigurationMenu.SelectionChanged += (o, e) => {
				var comboMenu = (ComboMenu<IConfigurationModel>)o;
				var newModel = e.Added;
				if (newModel == null)
					return;

				Runtime.RunInMainThread(() => {
					ActiveConfiguration = newModel;

					if (ConfigurationChanged != null)
						ConfigurationChanged(o, e);
				});
			};

			toolbar.RuntimeMenu.SelectionChanged += (o, e) => {
				var newModel = e.Added;
				if (newModel == null)
					return;

				using (var mutableModel = newModel.GetMutableModel()) {
					Runtime.RunInMainThread(() => {
						ActiveRuntime = newModel;

						var ea = new MonoDevelop.Components.MainToolbar.HandledEventArgs();
						if (RuntimeChanged != null)
							RuntimeChanged(o, ea);

						if (ea.Handled)
							ActiveRuntime = e.Removed;
					});
				}
			};

			toolbar.RunButton.Click += (o, e) => {
				if (RunButtonClicked != null)
					RunButtonClicked (o, e);
			};

			toolbar.SearchBar.SearchBar.TextChanged += (o, e) => {
				if (string.IsNullOrEmpty (SearchText) || SearchText == SearchPlaceholderMessage)
					return;

				if (SearchEntryChanged != null)
					SearchEntryChanged (o, e);
			};

			toolbar.SearchBar.SearchBar.LostKeyboardFocus += (o, e) => {
				if (SearchEntryLostFocus != null)
					SearchEntryLostFocus (o, e);
				toolbar.SearchBar.SearchText = toolbar.SearchBar.PlaceholderText;
			};

			toolbar.SearchBar.SearchBar.GotKeyboardFocus += (o, e) => {
				SearchEntryActivated?.Invoke (o, e);
			};

			toolbar.SearchBar.SearchBar.SizeChanged += (o, e) => {
				if (SearchEntryResized != null)
					SearchEntryResized (o, e);
			};

			toolbar.SearchBar.SearchBar.PreviewKeyDown += (o, e) => {
				var ka = new KeyEventArgs(KeyboardUtil.TranslateToXwtKey(e.Key), KeyboardUtil.GetModifiers(), e.IsRepeat, e.Timestamp);
				SendKeyPress(ka);
				e.Handled = ka.Handled;
			};

			toolbar.SearchBar.ClearIconClicked += (o, e) =>
			{
				SendKeyPress(new KeyEventArgs(Xwt.Key.Escape, KeyboardUtil.GetModifiers(), false, 0));
			};
        }
Esempio n. 56
0
 public AppToolBar(IToolBarService toolBarService)
 {
     this.toolBarService = toolBarService;
     toolBar             = new ToolBar();
 }
Esempio n. 57
0
        public void tooBarTop_ItemClicked(object sender, ToolBar.ToolBarItemClickArgs e)
        {
            try
            {
                ShowProcess();

                Save();

            }
            catch (Exception ex)
            {
                CommonFunction.ShowErrorMessage(ex.Message);
                CloseProcess();
            }
        }
Esempio n. 58
0
        /// <summary>
        /// 构造页面触发事件
        /// </summary>
        public void InitPara()
        {
            try
            {
                // 1s 冉龙军
                PARENT.Children.Add(loadbar);
                loadbar.Stop();
                // 1e
                client = new PersonnelServiceClient();

                kpiClient = new PerformanceServiceClient();
                kpiClient.GetKPIRecordPagingCompleted += new EventHandler <GetKPIRecordPagingCompletedEventArgs>(client_GetKPIRecordPagingCompleted);

                //orgClient = new OrganizationServiceClient();
                //orgClient.GetCompanyActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetCompanyActivedCompletedEventArgs>(orgClient_GetCompanyActivedCompleted);
                //orgClient.GetDepartmentActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetDepartmentActivedCompletedEventArgs>(orgClient_GetDepartmentActivedCompleted);
                //orgClient.GetPostActivedCompleted += new EventHandler<SMT.Saas.Tools.OrganizationWS.GetPostActivedCompletedEventArgs>(orgClient_GetPostActivedCompleted);

                DtGrid.CurrentCellChanged += new EventHandler <EventArgs>(DtGrid_CurrentCellChanged);
                this.Loaded += new RoutedEventHandler(Employee_Loaded);
                this.Loaded += new RoutedEventHandler(AuditState_Loaded);
                treeOrganization.SelectedClick += new EventHandler(treeOrganization_SelectedClick);

                //this.ToolBar.btnNew.Click += new RoutedEventHandler(btnAdd_Click);
                this.ToolBar.btnNew.Visibility     = Visibility.Collapsed;
                this.ToolBar.btnEdit.Visibility    = Visibility.Collapsed;
                this.ToolBar.btnDelete.Visibility  = Visibility.Collapsed;
                this.ToolBar.btnRefresh.Visibility = Visibility.Collapsed;
                this.ToolBar.BtnView.Visibility    = Visibility.Collapsed;
                // 1s 冉龙军
                this.ToolBar.btnAudit.Visibility = Visibility.Collapsed;

                this.ToolBar.cbxCheckState.Visibility        = Visibility.Collapsed;
                this.ToolBar.cbxCheckState.SelectionChanged += new SelectionChangedEventHandler(cbxCheckState_SelectionChanged);
                this.ToolBar.retNew.Visibility            = Visibility.Collapsed;
                this.ToolBar.retEdit.Visibility           = Visibility.Collapsed;
                this.ToolBar.retDelete.Visibility         = Visibility.Collapsed;
                this.ToolBar.retRefresh.Visibility        = Visibility.Collapsed;
                this.ToolBar.retAudit.Visibility          = Visibility.Collapsed;
                this.ToolBar.retAuditNoPass.Visibility    = Visibility.Collapsed;
                this.ToolBar.txtCheckStateName.Visibility = Visibility.Collapsed;

                // 1e
                ImageButton btnComplain = new ImageButton();
                btnComplain.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/Tool/ico_16_4405_d.png",
                                            Utility.GetResourceStr("COMPLAIN")).Click += new RoutedEventHandler(btnComplain_Click);

                ImageButton btnEditComplain = new ImageButton();
                btnEditComplain.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/Tool/18_service.png",
                                                Utility.GetResourceStr("EDIT")).Click += new RoutedEventHandler(btnEditComplain_Click);

                ImageButton btnViewComplain = new ImageButton();
                btnViewComplain.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/Tool/18_service.png",
                                                Utility.GetResourceStr("VIEWCOMPLAIN")).Click += new RoutedEventHandler(btnViewComplain_Click);

                ImageButton btnViewReview = new ImageButton();
                btnViewReview.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/Tool/ico_16_1036.png",
                                              Utility.GetResourceStr("VIEWREVIEW")).Click += new RoutedEventHandler(btnReview_Click);

                this.ToolBar.stpOtherAction.Children.Add(btnComplain);
                // 1s 冉龙军


                //this.ToolBar.stpOtherAction.Children.Add(btnEditComplain);  //修改


                this.ToolBar.stpOtherAction.Children.Add(ToolBar.AddPartition());
                // 1e
                // this.ToolBar.stpOtherAction.Children.Add(btnViewComplain);
                // 1s 冉龙军
                this.ToolBar.stpOtherAction.Children.Add(ToolBar.AddPartition());
                // 1e
                // this.ToolBar.stpOtherAction.Children.Add(btnViewReview);
            }
            catch (Exception ex)
            {
                //Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(ex.Message));
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Error);
            }
        }
Esempio n. 59
0
        private void CreateToolBar(string name, ToolBarInitialPos initialPos)
        {
            ToolBar temp = new ToolBar();
            temp.Name = name;
            temp.Overflow = ToolBarOverflow.Hide;
            temp.AllowHorizontalDock = true;
            temp.AllowRightToLeft = true;
            temp.AllowVerticalDock = true;
            temp.Closable = false;
            temp.Movable = true;
            temp.Tearable = true;
            temp.DockLine = 2;

            ToolBarDef tbd = new ToolBarDef();
            tbd.NWNToolsetDockName = GetDockNameFromPosEnum(initialPos);
            tbd.toolBar = temp;

            AllToolbars.Add(name, tbd);
        }
Esempio n. 60
0
        void CreateMenuToolBar()
        {
            var about = new Commands.About();
            var quit  = new Commands.Quit();

            if (Platform.Supports <MenuBar>())
            {
                Menu = new MenuBar
                {
                    Items =
                    {
                        // custom top-level menu items
                        new ButtonMenuItem {
                            Text = "&File", Items ={ new Command          {
                                                 MenuText = "File Command"
                                             } }
                        },
                        new ButtonMenuItem {
                            Text = "&Edit", Items ={ new Command          {
                                                 MenuText = "Edit Command"
                                             } }
                        },
                        new ButtonMenuItem {
                            Text = "&View", Items ={ new Command          {
                                                 MenuText = "View Command"
                                             } }
                        },
                        new ButtonMenuItem {
                            Text = "&Window", Order = 1000, Items ={ new Command          {
                                                 MenuText = "Window Command"
                                             } }
                        },
                    },
                    ApplicationItems =
                    {
                        // custom menu items for the application menu (Application on OS X, File on others)
                        new Command        {
                            MenuText = "Application command"
                        },
                        new ButtonMenuItem {
                            Text = "Application menu item"
                        }
                    },
                    HelpItems =
                    {
                        new Command {
                            MenuText = "Help Command"
                        }
                    },
                    QuitItem  = quit,
                    AboutItem = about
                };
            }

            if (Platform.Supports <ToolBar>())
            {
                // create and set the toolbar
                ToolBar = new ToolBar();

                ToolBar.Items.Add(about);
                if (Platform.Supports <CheckToolItem>())
                {
                    ToolBar.Items.Add(new SeparatorToolItem {
                        Type = SeparatorToolItemType.Divider
                    });
                    ToolBar.Items.Add(new CheckToolItem {
                        Text = "Check", Image = TestIcons.TestImage
                    });
                }
                if (Platform.Supports <RadioToolItem>())
                {
                    ToolBar.Items.Add(new SeparatorToolItem {
                        Type = SeparatorToolItemType.FlexibleSpace
                    });
                    ToolBar.Items.Add(new RadioToolItem {
                        Text = "Radio1", Image = TestIcons.TestIcon, Checked = true
                    });
                    ToolBar.Items.Add(new RadioToolItem {
                        Text = "Radio2", Image = TestIcons.TestImage
                    });
                }
                ;
            }
        }