protected void LayoutComponent() { this.SuspendLayout(); float[] xOffset = m_sPrinterProperty.GetXOffset(); float[] yOffset = m_sPrinterProperty.get_YOffset(); for (int i = 0; i < m_nButtonNum; i++) { RadioButton radio = this.m_radioButtonPointer[i]; ControlClone.RadioButtonClone(radio, m_RadioButtonSample); //this.m_RadioButtonSample.Appearance = System.Windows.Forms.Appearance.Button; //this.m_RadioButtonSample.FlatStyle = System.Windows.Forms.FlatStyle.Flat; //this.m_RadioButtonSample.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; radio.Size = new Size(this.m_nButtonWidth, this.m_nButtonHeight); radio.Visible = true; radio.TabIndex = m_RadioButtonSample.TabIndex + i; radio.Tag = i; int groupIndex = i / m_sPrinterProperty.nColorNum; int colorIndex = i % m_sPrinterProperty.nColorNum; Point locate; if (m_bZeroSpace) { locate = new Point(this.Width - m_Margin - (int)(m_Scale * i) - this.m_nButtonWidth, this.m_nButtonHeight * groupIndex + m_Margin); } else { locate = new Point(this.Width - m_Margin - (int)(m_Scale * xOffset[i]) - this.m_nButtonWidth, (int)(m_Scale * yOffset[colorIndex]) + this.m_nButtonHeight * groupIndex + m_Margin); } if (m_bScaleMin_Y) { locate.X += m_MarginMiddle; } else { locate.Y += m_MarginMiddle; } radio.Location = locate; radio.BackColor = m_sPrinterProperty.GetButtonColor(colorIndex); //radio.Paint += new PaintEventHandler(m_radioButtonExample_Paint); radio.CheckedChanged += new System.EventHandler(this.m_RadioButtonSample_CheckedChanged); } }
private void BuildVerticalGroup() { int start_x = this.m_TextBoxVerSample.Left; int start_y = this.m_TextBoxVerSample.Top; int width_GroupOld = m_GroupBoxVer.Width; int width_GroupVer = start_x; int width_con = this.m_TextBoxVerSample.Width; int space_x = 70; for (int i = 0; i < m_ColorNumAndColumnNum; i++) { int hg = i / m_ColorNum; Label label = this.m_LabelVerHeadIndex[i]; ControlClone.LabelClone(label, this.m_LabelVerSample); label.Location = new Point(start_x + space_x * i, this.m_LabelVerSample.Top); label.Width = width_con; int colorID = CoreInterface.GetLayoutColorID(i % m_ColorNum); if (m_HorColumnNum != 1) { label.Text = hg.ToString() + " (" + NewLayoutFun.GetColorName(colorID) + ")"; } else { label.Text = " (" + NewLayoutFun.GetColorName(colorID) + ")"; } label.Visible = true; m_GroupBoxVer.Controls.Add(this.m_LabelVerHeadIndex[i]); NumericUpDown textBox = this.m_TextBoxVer[i]; ControlClone.NumericUpDownClone(textBox, this.m_TextBoxVerSample); textBox.Location = new Point(start_x + space_x * i, this.m_TextBoxVerSample.Top); textBox.Width = width_con; textBox.Value = 0; textBox.Visible = true; m_GroupBoxVer.Controls.Add(this.m_TextBoxVer[i]); width_GroupVer += space_x; } if (width_GroupOld < width_GroupVer) { m_GroupBoxVer.Width = width_GroupVer; } m_GroupBoxVer.ResumeLayout(false); }
public void OnPrinterPropertyChange(SPrinterProperty sp) { spp = sp; bool bsupportwhite = (sp.nWhiteInkNum & 0x0F) > 0; bool bsupportVarnish = (sp.nWhiteInkNum >> 4) > 0; this.spotColorMaskSetting1.Visible = bsupportwhite; this.spotColorMaskSetting2.Visible = bsupportVarnish; label1.Visible = cbo_MultipleInk.Visible = bsupportwhite; label2.Visible = cbo_MultipleVavishInk.Visible = bsupportVarnish; this.grouperGrey.Visible = NewLayoutFun.IsSupportGray; if (!bsupportwhite && bsupportVarnish) { this.spotColorMaskSetting2.Location = this.spotColorMaskSetting1.Location; label2.Location = label1.Location; cbo_MultipleVavishInk.Location = cbo_MultipleInk.Location; } if (!bsupportwhite && !bsupportVarnish) { this.grouperGrey.Location = this.spotColorMaskSetting1.Location; } else if (bsupportwhite && !bsupportVarnish) { this.grouperGrey.Location = this.spotColorMaskSetting2.Location; } this.spotColorMaskSetting1.OnPrinterPropertyChange(sp); this.spotColorMaskSetting2.OnPrinterPropertyChange(sp); this.spotColorMaskSetting1.Title = ResString.GetResString("EnumLayerType_White"); this.spotColorMaskSetting2.Title = ResString.GetResString("EnumLayerType_Varnish"); checkBox14plTo42pl.Visible = false; //SPrinterProperty.IsSurpportVolumeConvert(sp.ePrinterHead); checkBoxEnableSingleLayerMode.Visible = false; colorNum = CoreInterface.GetLayoutColorNum(); LabelGreyList.Clear(); NumericUpDownGreyList.Clear(); if (colorNum > 0) { labelBaseGrey.Text = NewLayoutFun.GetColorName(CoreInterface.GetLayoutColorID(0)); LabelGreyList.Add(labelBaseGrey); NumericUpDownGreyList.Add(m_numAllpercentBaseGrey); LineHeight = 25; for (int i = 1; i < colorNum; i++) { Label labelGrey = new Label(); ControlClone.LabelClone(labelGrey, this.labelBaseGrey); labelGrey.Location = new Point(labelBaseGrey.Location.X, labelBaseGrey.Location.Y + LineHeight); labelGrey.Text = NewLayoutFun.GetColorName(CoreInterface.GetLayoutColorID(i)); labelGrey.Width = labelBaseGrey.Width; labelGrey.Visible = true; LabelGreyList.Add(labelGrey); grouperGrey.Controls.Add(labelGrey); NumericUpDown numericUpDownGrey = new NumericUpDown(); ControlClone.NumericUpDownClone(numericUpDownGrey, m_numAllpercentBaseGrey); numericUpDownGrey.Location = new Point(m_numAllpercentBaseGrey.Location.X, m_numAllpercentBaseGrey.Location.Y + LineHeight); numericUpDownGrey.Value = 0; numericUpDownGrey.Visible = true; numericUpDownGrey.Width = m_numAllpercentBaseGrey.Width; NumericUpDownGreyList.Add(numericUpDownGrey); grouperGrey.Controls.Add(numericUpDownGrey); LineHeight += 25; } } this.isDirty = false; }
private void LayoutComponent() { m_GroupBoxTemperature.SuspendLayout(); ///True Layout /// int start_x, end_x, space_x, width_con; int start_y, end_y, space_y; start_x = this.m_CheckboxHeadSample.Left; start_y = this.m_CheckboxHeadSample.Top; space_y = this.m_CheckboxHeadSample.Height + 8; end_x = this.m_GroupBoxTemperature.Width; width_con = this.m_CheckboxHeadSample.Width; CalculateHorNum(m_HeadNum, start_x, end_x, ref width_con, out space_x); int CurY = start_y + space_y; end_y = CurY; int buttonY = m_GroupBoxTemperature.Bottom + space_y; m_ButtonToBoard.Location = new Point(m_ButtonToBoard.Location.X, buttonY); m_ButtonRefresh.Location = new Point(m_ButtonRefresh.Location.X, buttonY); m_ButtonDefault.Location = new Point(m_ButtonDefault.Location.X, buttonY); float maxval = (float)(100.0f / 2.54); float minval = (float)(-100.0f / 2.54); for (int i = 0; i < m_HeadNum; i++) { int curX = start_x + space_x * i; int curY = start_y; //curY += space_y; CheckBox checkbox = this.m_CheckBoxHeadMask[i]; ControlClone.CheckBoxClone(checkbox, this.m_CheckboxHeadSample); checkbox.Location = new Point(curX, curY); checkbox.Width = width_con; checkbox.TabIndex = m_HeadNum + i; checkbox.TabStop = false; checkbox.Text = (i + 1).ToString(); checkbox.Visible = true; curY += space_y; NumericUpDown textBox = this.m_NumericUpDownXs[i]; ControlClone.NumericUpDownClone(textBox, this.m_NumericUpDownXSample); textBox.Minimum = new decimal(minval); textBox.Maximum = new decimal(maxval); //textBox.Increment = new decimal(0.1f * cofficient_voltage); textBox.Location = new Point(curX, curY); textBox.Width = width_con; textBox.TabIndex = m_HeadNum + i; textBox.TabStop = false; textBox.Text = "0"; textBox.Visible = true; textBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.m_TextBox_KeyDown); textBox.Leave += new System.EventHandler(this.m_CheckBoxControl_Leave); curY += space_y; textBox = this.m_NumericUpDownYs[i]; ControlClone.NumericUpDownClone(textBox, this.m_NumericUpDownYSample); textBox.Minimum = new decimal(minval); textBox.Maximum = new decimal(maxval); //textBox.Increment = new decimal(0.1f * cofficient_voltage); textBox.Location = new Point(curX, curY); textBox.Width = width_con; textBox.TabIndex = m_HeadNum * 2 + i; textBox.Text = "0"; textBox.Visible = false; textBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.m_TextBox_KeyDown); textBox.Leave += new System.EventHandler(this.m_CheckBoxControl_Leave); } }