Exemplo n.º 1
0
 private void InitializeComponent()
 {
     System.Windows.Forms.Label label2;
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CommonComponentItem));
     System.Windows.Forms.Label label3;
     System.Windows.Forms.Label label4;
     System.Windows.Forms.Label label5;
     System.Windows.Forms.Label label6;
     System.Windows.Forms.Label label1;
     this.settingLabel = new System.Windows.Forms.Label();
     this.gradationCheckBox = new System.Windows.Forms.CheckBox();
     this.fileLoadButton = new System.Windows.Forms.Button();
     this.label7 = new System.Windows.Forms.Label();
     this.iconFileTtextBox = new System.Windows.Forms.TextBox();
     this.resetSettingButton = new System.Windows.Forms.Button();
     this.figureComboBox = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.FigureComboBox();
     this.fillColorBrushComboBox = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.BrushComboBox();
     this.centerColorBrushComboBox = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.BrushComboBox();
     this.lineColorBrushComboBox = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.BrushComboBox();
     this.textColorBrushComboBox = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.BrushComboBox();
     this.pCanvas = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PToolBoxCanvas();
     label2 = new System.Windows.Forms.Label();
     label3 = new System.Windows.Forms.Label();
     label4 = new System.Windows.Forms.Label();
     label5 = new System.Windows.Forms.Label();
     label6 = new System.Windows.Forms.Label();
     label1 = new System.Windows.Forms.Label();
     this.SuspendLayout();
     //
     // label2
     //
     resources.ApplyResources(label2, "label2");
     label2.Name = "label2";
     //
     // label3
     //
     resources.ApplyResources(label3, "label3");
     label3.Name = "label3";
     //
     // label4
     //
     resources.ApplyResources(label4, "label4");
     label4.Name = "label4";
     //
     // label5
     //
     resources.ApplyResources(label5, "label5");
     label5.Name = "label5";
     //
     // label6
     //
     resources.ApplyResources(label6, "label6");
     label6.Name = "label6";
     //
     // settingLabel
     //
     resources.ApplyResources(this.settingLabel, "settingLabel");
     this.settingLabel.Name = "settingLabel";
     //
     // gradationCheckBox
     //
     resources.ApplyResources(this.gradationCheckBox, "gradationCheckBox");
     this.gradationCheckBox.Name = "gradationCheckBox";
     this.gradationCheckBox.UseVisualStyleBackColor = true;
     this.gradationCheckBox.CheckedChanged += new System.EventHandler(this.gradationCheckBox_CheckedChanged);
     //
     // fileLoadButton
     //
     resources.ApplyResources(this.fileLoadButton, "fileLoadButton");
     this.fileLoadButton.Name = "fileLoadButton";
     this.fileLoadButton.UseVisualStyleBackColor = true;
     this.fileLoadButton.Click += new System.EventHandler(this.openFileDialogClick);
     //
     // label7
     //
     resources.ApplyResources(this.label7, "label7");
     this.label7.Name = "label7";
     //
     // iconFileTtextBox
     //
     resources.ApplyResources(this.iconFileTtextBox, "iconFileTtextBox");
     this.iconFileTtextBox.Name = "iconFileTtextBox";
     //
     // resetSettingButton
     //
     resources.ApplyResources(this.resetSettingButton, "resetSettingButton");
     this.resetSettingButton.Name = "resetSettingButton";
     this.resetSettingButton.UseVisualStyleBackColor = true;
     this.resetSettingButton.Click += new System.EventHandler(this.resetButton_Click);
     //
     // figureComboBox
     //
     this.figureComboBox.Figure = "Rectangle";
     resources.ApplyResources(this.figureComboBox, "figureComboBox");
     this.figureComboBox.Name = "figureComboBox";
     this.figureComboBox.TextChange += new System.EventHandler(this.figureBox_TextChange);
     //
     // fillColorBrushComboBox
     //
     resources.ApplyResources(this.fillColorBrushComboBox, "fillColorBrushComboBox");
     this.fillColorBrushComboBox.Name = "fillColorBrushComboBox";
     this.fillColorBrushComboBox.BrushChange += new System.EventHandler(this.fillBrush_BrushChange);
     //
     // centerColorBrushComboBox
     //
     this.centerColorBrushComboBox.Brush = Brushes.Black;
     resources.ApplyResources(this.centerColorBrushComboBox, "centerColorBrushComboBox");
     this.centerColorBrushComboBox.Name = "centerColorBrushComboBox";
     this.centerColorBrushComboBox.BrushChange += new EventHandler(this.centerBrush_BrushChange);
     //
     // lineColorBrushComboBox
     //
     this.lineColorBrushComboBox.Brush = Brushes.Black;
     resources.ApplyResources(this.lineColorBrushComboBox, "lineColorBrushComboBox");
     this.lineColorBrushComboBox.Name = "lineColorBrushComboBox";
     this.lineColorBrushComboBox.BrushChange += new System.EventHandler(this.lineBrush_BrushChange);
     //
     // textColorBrushComboBox
     //
     this.textColorBrushComboBox.Brush = Brushes.Black;
     resources.ApplyResources(this.textColorBrushComboBox, "textColorBrushComboBox");
     this.textColorBrushComboBox.Name = "textColorBrushComboBox";
     this.textColorBrushComboBox.BrushChange += new System.EventHandler(this.textBrush_BrushChange);
     //
     // pCanvas
     //
     this.pCanvas.AllowDrop = true;
     this.pCanvas.BackColor = System.Drawing.Color.Silver;
     this.pCanvas.GridFitText = false;
     resources.ApplyResources(this.pCanvas, "pCanvas");
     this.pCanvas.Name = "pCanvas";
     this.pCanvas.Object = null;
     this.pCanvas.RegionManagement = true;
     this.pCanvas.Setting = null;
     //
     // label1
     //
     resources.ApplyResources(label1, "label1");
     label1.Name = "label1";
     //
     // CommonComponentItem
     //
     resources.ApplyResources(this, "$this");
     this.Controls.Add(label1);
     this.Controls.Add(this.figureComboBox);
     this.Controls.Add(this.resetSettingButton);
     this.Controls.Add(this.fillColorBrushComboBox);
     this.Controls.Add(this.centerColorBrushComboBox);
     this.Controls.Add(this.lineColorBrushComboBox);
     this.Controls.Add(this.textColorBrushComboBox);
     this.Controls.Add(this.iconFileTtextBox);
     this.Controls.Add(this.label7);
     this.Controls.Add(this.fileLoadButton);
     this.Controls.Add(this.gradationCheckBox);
     this.Controls.Add(label6);
     this.Controls.Add(label5);
     this.Controls.Add(label4);
     this.Controls.Add(label3);
     this.Controls.Add(label2);
     this.Controls.Add(this.settingLabel);
     this.Controls.Add(this.pCanvas);
     this.Name = "CommonComponentItem";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemplo n.º 2
0
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ComponentItem));
     this.groupBox = new System.Windows.Forms.GroupBox();
     this.label1 = new System.Windows.Forms.Label();
     this.resetButton = new System.Windows.Forms.Button();
     this.isGradation = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PropertyCheckBoxItem();
     this.figureBox = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.FigureComboBox();
     this.textBrush = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PropertyBrushItem();
     this.lineBrush = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PropertyBrushItem();
     this.fillBrush = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PropertyBrushItem();
     this.centerBrush = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PropertyBrushItem();
     this.iconFile = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PropertyOpenFileItem();
     this.pCanvas = new Ecell.IDE.Plugins.PathwayWindow.UIComponent.PToolBoxCanvas();
     this.groupBox.SuspendLayout();
     this.SuspendLayout();
     //
     // groupBox
     //
     this.groupBox.Controls.Add(this.label1);
     this.groupBox.Controls.Add(this.resetButton);
     this.groupBox.Controls.Add(this.isGradation);
     this.groupBox.Controls.Add(this.figureBox);
     this.groupBox.Controls.Add(this.textBrush);
     this.groupBox.Controls.Add(this.lineBrush);
     this.groupBox.Controls.Add(this.fillBrush);
     this.groupBox.Controls.Add(this.centerBrush);
     this.groupBox.Controls.Add(this.iconFile);
     this.groupBox.Controls.Add(this.pCanvas);
     resources.ApplyResources(this.groupBox, "groupBox");
     this.groupBox.Name = "groupBox";
     this.groupBox.TabStop = false;
     //
     // label1
     //
     resources.ApplyResources(this.label1, "label1");
     this.label1.Name = "label1";
     //
     // resetButton
     //
     resources.ApplyResources(this.resetButton, "resetButton");
     this.resetButton.Name = "resetButton";
     this.resetButton.UseVisualStyleBackColor = true;
     this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
     //
     // isGradation
     //
     resources.ApplyResources(this.isGradation, "isGradation");
     this.isGradation.Checked = false;
     this.isGradation.Name = "isGradation";
     this.isGradation.CheckedChanged += new System.EventHandler(this.isGradation_CheckedChanged);
     //
     // figureBox
     //
     resources.ApplyResources(this.figureBox, "figureBox");
     this.figureBox.Figure = "Rectangle";
     this.figureBox.Name = "figureBox";
     this.figureBox.TextChange += new System.EventHandler(this.figureBox_TextChange);
     //
     // textBrush
     //
     resources.ApplyResources(this.textBrush, "textBrush");
     this.textBrush.Name = "textBrush";
     this.textBrush.BrushChange += new System.EventHandler(this.textBrush_BrushChange);
     //
     // lineBrush
     //
     resources.ApplyResources(this.lineBrush, "lineBrush");
     this.lineBrush.Name = "lineBrush";
     this.lineBrush.BrushChange += new System.EventHandler(this.lineBrush_BrushChange);
     //
     // fillBrush
     //
     resources.ApplyResources(this.fillBrush, "fillBrush");
     this.fillBrush.Name = "fillBrush";
     this.fillBrush.BrushChange += new System.EventHandler(this.fillBrush_BrushChange);
     //
     // centerBrush
     //
     resources.ApplyResources(this.centerBrush, "centerBrush");
     this.centerBrush.Name = "centerBrush";
     this.centerBrush.BrushChange += new System.EventHandler(this.fillBrush_BrushChange);
     //
     // iconFile
     //
     resources.ApplyResources(this.iconFile, "iconFile");
     this.iconFile.FileName = "";
     this.iconFile.Filter = resources.GetString("iconFile.Filter");
     this.iconFile.FilterIndex = 0;
     this.iconFile.Name = "iconFile";
     this.iconFile.FileChange += new System.EventHandler(this.iconFile_FileChange);
     //
     // pCanvas
     //
     this.pCanvas.AllowDrop = true;
     this.pCanvas.BackColor = System.Drawing.Color.Silver;
     this.pCanvas.GridFitText = false;
     resources.ApplyResources(this.pCanvas, "pCanvas");
     this.pCanvas.Name = "pCanvas";
     this.pCanvas.Object = null;
     this.pCanvas.RegionManagement = true;
     this.pCanvas.Setting = null;
     //
     // ComponentItem
     //
     resources.ApplyResources(this, "$this");
     this.Controls.Add(this.groupBox);
     this.Name = "ComponentItem";
     this.groupBox.ResumeLayout(false);
     this.groupBox.PerformLayout();
     this.ResumeLayout(false);
 }
Exemplo n.º 3
0
 private void SetCursor(PToolBoxCanvas canvas, Cursor cursor)
 {
     canvas.Cursor = cursor;
     m_con.Canvas.PCanvas.Cursor = cursor;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initialise EventHandler.
        /// </summary>
        /// <param name="canvas"></param>
        /// <param name="e"></param>
        private void SetEventHandler(PToolBoxCanvas canvas, PInputEventArgs e)
        {
            if (m_con.Canvas == null)
                return;
            if (m_object != null)
            {
                ResetEventHandler();
                ResetCurrentStencil();
            }
            m_con.Menu.ResetEventHandler();

            // Set Cursor
            SetCursor(canvas);

            // Set Template.
            m_object = canvas.Setting.CreateTemplate();
            m_object.Pickable = false;
            m_canvas = m_con.Canvas;

            Point systemPos = GetSystemPos(e);
            m_object.Center = m_canvas.SystemPosToCanvasPos(systemPos);
            m_object.Pickable = false;
        }
Exemplo n.º 5
0
 private void SetCursor(PToolBoxCanvas canvas)
 {
     Bitmap image = (Bitmap)canvas.Setting.Icon;
     Cursor cursor = new Cursor(image.GetHicon());
     SetCursor(canvas, cursor);
 }
Exemplo n.º 6
0
 private void SetCurrentStencil(PToolBoxCanvas canvas)
 {
     m_stencils.Stencil = canvas;
     m_stencils.Stencil.BackColor = Color.Yellow;
 }
Exemplo n.º 7
0
 private void Stencil_MouseDown(object sender, MouseEventArgs e)
 {
     m_stencil = null;
 }
Exemplo n.º 8
0
 private void SetNewItem(ComponentSetting cs)
 {
     PToolBoxCanvas pCanvas = new PToolBoxCanvas(cs);
     ToolBoxDragHandler eventHandler = new ToolBoxDragHandler(this);
     pCanvas.AddInputEventListener(eventHandler);
     pCanvas.ContextMenuStrip = this.StencilMenuStrip;
     //pCanvas.MouseDown += new MouseEventHandler(Stencil_MouseDown);
     flowLayoutPanel.Controls.Add(pCanvas);
 }
Exemplo n.º 9
0
        private void DeleteStencilMenuItem_Click(object sender, System.EventArgs e)
        {
            if (m_stencil == null)
                return;
            if (m_stencil.Setting.IsDefault)
            {
                Util.ShowErrorDialog(MessageResources.ErrDeleteDefaultStencil);
                return;
            }

            // Remove Stencil
            m_stencil.Setting.IsStencil = false;
            this.flowLayoutPanel.Controls.Remove(m_stencil);
            m_stencil = null;
            m_con.ComponentManager.SaveSettings();
        }