Пример #1
0
 private int addTableRow()
 {
     int index = tlpProperties.RowCount++;
     RowStyle style = new RowStyle(SizeType.AutoSize);
     tlpProperties.RowStyles.Add(style);
     return index;
 }
Пример #2
0
 private int AddTableRow()
 {
     int result = docFileTablePanel.RowCount++;
     RowStyle style = new RowStyle(SizeType.Absolute, ROWSIZE);
     docFileTablePanel.RowStyles.Add(style);
     return result;
 }
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="c"></param>
 public void AddControl(Control c)
 {
     this.tableLayoutPanel1.RowCount += 1;
     this.tableLayoutPanel1.Controls.Add(c, 0, this.tableLayoutPanel1.RowCount - 1);
     RowStyle style = new RowStyle(SizeType.Absolute, c.Height);
     this.tableLayoutPanel1.RowStyles.Add(style);
 }
Пример #4
0
		private void tableMain_SizeChanged(object sender, EventArgs e)
		{
			ColumnStyle columnLeft = new ColumnStyle(SizeType.Absolute, 200);
			ColumnStyle columnRight = new ColumnStyle(SizeType.Absolute, 220);
			ColumnStyle columnFill = new ColumnStyle(SizeType.Percent, 100);
			RowStyle rowTop = new RowStyle(SizeType.Absolute, 145);
			RowStyle rowBottom = new RowStyle(SizeType.Absolute, 256);
			RowStyle rowFill = new RowStyle(SizeType.Percent, 100);

			tableMain.SuspendLayout();

			if (tableMain.Width > columnLeft.Width + columnRight.Width)
			{
				tableMain.ColumnStyles[0] = columnFill;
				tableMain.ColumnStyles[1] = columnRight;
			}
			else
			{
				tableMain.ColumnStyles[0] = columnLeft;
				tableMain.ColumnStyles[1] = columnFill;
			}

			if (tableMain.Height > rowTop.Height + rowBottom.Height)
			{
				tableMain.RowStyles[0] = rowFill;
				tableMain.RowStyles[1] = rowBottom;
			}
			else
			{
				tableMain.RowStyles[0] = rowTop;
				tableMain.RowStyles[1] = rowFill;
			}

			tableMain.ResumeLayout();
		}
Пример #5
0
        public void InitOnce(TableLayoutPanel grid, ViewModel viewModel)
        {
            _Grid = grid;
            _Style = new RowStyle(SizeType.Absolute, 27F);

            Dock = DockStyle.Fill;

            _Label = new Label();
            _Label.TextAlign = ContentAlignment.MiddleRight;
            _Label.Dock = DockStyle.Fill;

            TbData.GotFocus += new EventHandler(TbData_GotFocus);

            BtView.Image = viewModel.GetImage("att-file-preview");
            _Body.ShowTips(BtView, "查看文件");
            BtOpen.Image = viewModel.GetImage("att-file-append");
            _Body.ShowTips(BtOpen, "添加文件");

            //BtFill.Image = viewModel.GetImage("att-copy");
            //_Body.ShowTips(BtFill, "复制");
            BtCopy.Image = viewModel.GetImage("script-fill-16");
            _Body.ShowTips(BtCopy, "填充");

            InitSpec(TbData);
        }
Пример #6
0
		public void CtorTest3 ()
		{
			RowStyle rs = new RowStyle (SizeType.Absolute, 5.0f);
			
			Assert.AreEqual (5.0, rs.Height, "1");
			Assert.AreEqual (SizeType.Absolute, rs.SizeType, "2");
		}
Пример #7
0
        private void SetTableStyle()
        {
            // 行スタイル
            for (; table.RowCount != table.RowStyles.Count;)
            {
                if (table.RowCount < table.RowStyles.Count)
                {
                    this.table.RowStyles.RemoveAt(this.table.RowStyles.Count - 1);
                }
                else
                {
                    var rowStyle = new RowStyle(SizeType.Percent, (float)100.0 / table.RowCount);
                    this.table.RowStyles.Add(rowStyle);
                }
            }

            // 列スタイル
            for (; table.ColumnCount != table.ColumnStyles.Count;)
            {
                if (table.ColumnCount < table.ColumnStyles.Count)
                {
                    this.table.ColumnStyles.RemoveAt(this.table.ColumnStyles.Count - 1);
                }
                else
                {
                    var colStyle = new ColumnStyle(SizeType.Percent, (float)100.0 / table.ColumnCount);
                    this.table.ColumnStyles.Add(colStyle);
                }
            }
        }
Пример #8
0
        public void addAudio(int id, int pos)
        {
            if (pos > 15)
            {
                this.Invoke((MethodInvoker)delegate()
                {
                    this.audioTable.RowCount++;
                    RowStyle style = new RowStyle(SizeType.AutoSize);
                    this.audioTable.RowStyles.Add(style);
                });
            }
            Label num, artist, title, dur;
            num = new Label();
            num.Text=Convert.ToString(pos);
            num.Anchor = (AnchorStyles.Left);

            title = new Label();
            title.Text=this.audio.audio[id].title;
            title.Anchor = (AnchorStyles.Left);

            artist = new Label();
            artist.Text = this.audio.audio[id].artist;
            artist.Anchor = (AnchorStyles.Left);

            dur = new Label();
            string temp = Convert.ToString(this.audio.audio[id].duration % 60);
            if ((this.audio.audio[id].duration % 60) < 10)
                temp = "0" + temp;
            dur.Text=Convert.ToString(this.audio.audio[id].duration/60)+":"+temp;
            dur.Anchor = (AnchorStyles.Left);

            dur.TextAlign = ContentAlignment.MiddleLeft;
            artist.TextAlign = ContentAlignment.MiddleLeft;
            title.TextAlign = ContentAlignment.MiddleLeft;
            num.TextAlign = ContentAlignment.MiddleLeft;

            //dur.AutoSize = true;
            //artist.AutoSize = true; //подгоняем
            //title.AutoSize = true;
            //num.AutoSize = true;

            dur.Width = 40;
            artist.Width = 150; //обрезаем
            title.Width = 190;
            num.Width = 30;

            dur.Click += new System.EventHandler(this.audio_Click);
            artist.Click += new System.EventHandler(this.audio_Click);
            title.Click += new System.EventHandler(this.audio_Click);
            num.Click += new System.EventHandler(this.audio_Click);

            this.Invoke((MethodInvoker)delegate()
            {
                this.audioTable.Controls.Add(num, 0, pos);
                this.audioTable.Controls.Add(title, 1, pos);
                this.audioTable.Controls.Add(artist, 2, pos);
                this.audioTable.Controls.Add(dur, 3, pos);
            });
        }
 private int AddTableRow(TableLayoutPanel tlp)
 {
     tlp.RowStyles.Clear();
     int index = tlp.RowCount++;
     RowStyle style = new RowStyle(SizeType.AutoSize);
     tlp.RowStyles.Add(style);
     return index;
 }
Пример #10
0
        private void AddLayoutRow( int pixels )
        {
            RowStyle rs = new RowStyle(SizeType.Absolute);
            rs.Height = pixels;
            tableLayoutPanel.RowCount++;
            tableLayoutPanel.RowStyles.Add(rs);

            tableLayoutPanel.Controls.Add( new Label() , 0, tableLayoutPanel.RowCount);     // need a control or else the tablelayoutpanel won't work correctly
        }
Пример #11
0
        public FormCompass( FormMain parent )
        {
            InitializeComponent();

            MainFontColor = Color.FromArgb( 0x00, 0x00, 0x00 );
            SubFontColor = Color.FromArgb( 0x88, 0x88, 0x88 );

            ControlHelper.SetDoubleBuffered( BasePanel );
            ControlHelper.SetDoubleBuffered( TableEnemyFleet );
            ControlHelper.SetDoubleBuffered( TableEnemyMember );

            TableEnemyMember.SuspendLayout();
            ControlMembers = new TableEnemyMemberControl[6];
            for ( int i = 0; i < ControlMembers.Length; i++ ) {
                ControlMembers[i] = new TableEnemyMemberControl( this, TableEnemyMember, i );
            }
            TableEnemyMember.ResumeLayout();

            TableEnemyCandidate.SuspendLayout();
            ControlCandidates = new TableEnemyCandidateControl[6];
            for ( int i  = 0; i < ControlCandidates.Length; i++ ) {
                ControlCandidates[i] = new TableEnemyCandidateControl( this, TableEnemyCandidate, i );
            }
            //row/column style init
            for ( int y = 0; y < TableEnemyCandidate.RowCount; y++ ) {
                var rs = new RowStyle( SizeType.AutoSize );
                if ( TableEnemyCandidate.RowStyles.Count <= y )
                    TableEnemyCandidate.RowStyles.Add( rs );
                else
                    TableEnemyCandidate.RowStyles[y] = rs;
            }
            for ( int x = 0; x < TableEnemyCandidate.ColumnCount; x++ ) {
                var cs = new ColumnStyle( SizeType.AutoSize );
                if ( TableEnemyCandidate.ColumnStyles.Count <= x )
                    TableEnemyCandidate.ColumnStyles.Add( cs );
                else
                    TableEnemyCandidate.ColumnStyles[x] = cs;
            }
            TableEnemyCandidate.ResumeLayout();

            //BasePanel.SetFlowBreak( TextMapArea, true );
            BasePanel.SetFlowBreak( TextDestination, true );
            //BasePanel.SetFlowBreak( TextEventKind, true );
            BasePanel.SetFlowBreak( TextEventDetail, true );

            TextDestination.ImageList = ResourceManager.Instance.Equipments;
            TextEventKind.ImageList = ResourceManager.Instance.Equipments;
            TextEventDetail.ImageList = ResourceManager.Instance.Equipments;
            TextFormation.ImageList = ResourceManager.Instance.Icons;
            TextAirSuperiority.ImageList = ResourceManager.Instance.Equipments;
            TextAirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;

            ConfigurationChanged();

            Icon = ResourceManager.ImageToIcon( ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormCompass] );
        }
Пример #12
0
        /// <summary>
        /// Adds checkbox to panel
        /// </summary>
        /// <param name="panel">Panel</param>
        public void AddCheckBoxs(TableLayoutPanel panel)
        {
            var questions = inferenceModule.Questions;
            var checkBoxs = questions.Select(question => new ThreeStateCheckBox(question.Id, question.Content)).ToArray();

            foreach (ThreeStateCheckBox checkBox in checkBoxs)
            {
                RowStyle style = new RowStyle(SizeType.Absolute, 25);
                panel.RowStyles.Add(style);
                int index = panel.RowCount;
                panel.Controls.Add(checkBox, 0, index);
                panel.RowCount++;
            }
        }
Пример #13
0
			public void AddToTable( TableLayoutPanel table, int row ) {

				table.Controls.Add( ShipName, 0, row );
				table.Controls.Add( Equipments, 1, row );

				#region set RowStyle
				RowStyle rs = new RowStyle( SizeType.Absolute, 21 );

				if ( table.RowStyles.Count > row )
					table.RowStyles[row] = rs;
				else
					while ( table.RowStyles.Count <= row )
						table.RowStyles.Add( rs );
				#endregion
			}
Пример #14
0
        public void InitOnce(TableLayoutPanel grid, ViewModel viewModel)
        {
            _Grid = grid;
            _Style = new RowStyle(SizeType.Absolute, 60F);

            Dock = DockStyle.Fill;

            _Label = new Label();
            _Label.TextAlign = ContentAlignment.MiddleRight;
            _Label.Dock = DockStyle.Fill;

            TbData.GotFocus += new EventHandler(TbData_GotFocus);

            InitSpec(TbData);
        }
			public void AddToTable( TableLayoutPanel table, int row ) {

				table.Controls.Add( Number, 0, row );
				table.Controls.Add( State, 1, row );

				#region set RowStyle
				RowStyle rs = new RowStyle( SizeType.AutoSize, 0 );

				if ( table.RowStyles.Count > row )
					table.RowStyles[row] = rs;
				else
					while ( table.RowStyles.Count <= row )
						table.RowStyles.Add( rs );
				#endregion

			}
        public LoginControl()
        {
            lblHostname.Text = "Hostname";
            lblHostport.Text = "Port";
            lblUsername.Text = "Username";
            lblPassword.Text = "Password";
            btnConnectDisconnect.Text = "Connect";

            txtHostname.Text = "meridian103.meridian59.com";
            txtHostport.Maximum = UInt16.MaxValue;
            txtHostport.Value = 5903;

            txtPassword.PasswordChar = Convert.ToChar("*");

            lblHostname.Width = lblUsername.Width = lblPassword.Width = lblHostport.Width = 60;
            lblHostname.AutoSize = lblUsername.AutoSize = lblPassword.AutoSize = lblHostport.AutoSize = false;
            lblHostname.TextAlign = lblUsername.TextAlign = lblPassword.TextAlign = lblHostport.TextAlign = ContentAlignment.MiddleLeft;
            txtHostname.Width = txtUsername.Width = txtPassword.Width = txtHostport.Width = btnConnectDisconnect.Width = 140;
            txtHostname.Height = txtUsername.Height = txtPassword.Height = txtHostport.Height = btnConnectDisconnect.Height = 25;

            tblMain.RowCount = 4;
            tblMain.ColumnCount = 2;

            tblMain.Controls.Add(lblUsername, 0, 0);
            tblMain.Controls.Add(txtUsername, 1, 0);
            tblMain.Controls.Add(lblPassword, 0, 1);
            tblMain.Controls.Add(txtPassword, 1, 1);
            tblMain.Controls.Add(lblHostname, 0, 2);
            tblMain.Controls.Add(txtHostname, 1, 2);
            tblMain.Controls.Add(lblHostport, 0, 3);
            tblMain.Controls.Add(txtHostport, 1, 3);
            tblMain.Controls.Add(btnConnectDisconnect, 1, 4);

            tblMain.Dock = DockStyle.Fill;
            tblMain.Padding = new Padding(2);

            RowStyle defaultRowStyle;
            for (int i = 0; i < tblMain.RowCount; i++)
            {
                defaultRowStyle = new RowStyle(SizeType.Absolute, 25);
                tblMain.RowStyles.Add(defaultRowStyle);
            }

            btnConnectDisconnect.Click += new EventHandler(btnConnectDisconnect_Click);

            this.Controls.Add(tblMain);
        }
Пример #17
0
 public override void Init(CarFormEx carform)
 {
     base.Init(carform);
     GroupBox box = new GroupBox {
         Text = "参数设置",
         Dock = DockStyle.Fill
     };
     carform.pnlContainer.Controls.Add(box);
     TableLayoutPanel tb = new TableLayoutPanel {
         Dock = DockStyle.Fill,
         RowCount = 1,
         ColumnCount = 2
     };
     tb.RowStyles.Clear();
     tb.ColumnStyles.Clear();
     tb.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
     for (int i = 0; i < 1; i++)
     {
         RowStyle rowStyle = new RowStyle {
             Height = 25f,
             SizeType = SizeType.Absolute
         };
         ColumnStyle columnStyle = new ColumnStyle {
             Width = 113f,
             SizeType = SizeType.Absolute
         };
         tb.RowStyles.Add(rowStyle);
         tb.ColumnStyles.Add(columnStyle);
     }
     Label con = new Label {
         Text = "通道类型:",
         TextAlign = ContentAlignment.MiddleRight,
         Dock = DockStyle.Fill
     };
     this.SetControl(tb, con, 0, 0);
     StarNetTextBox box2 = new StarNetTextBox {
         Name = "txtip",
         MaxLength = 100,
         Width = 160,
         Dock = DockStyle.Left,
         DestinationMarshalByRefObject = this.cmd,
         PropertyName = "RepeatTimes",
         PropertyType = System.Type.GetType("System.Int32")
     };
     this.SetControl(tb, box2, 0, 1);
     box.Controls.Add(tb);
 }
Пример #18
0
        public FormFleetOverview( FormMain parent )
        {
            InitializeComponent();

            ConfigurationChanged();

            ControlHelper.SetDoubleBuffered( TableFleet );

            ControlFleet = new List<TableFleetControl>( 4 );
            for ( int i = 0; i < 4; i++ ) {
                ControlFleet.Add( new TableFleetControl( this, i + 1, TableFleet ) );
            }

            #region CombinedTag
            {
                CombinedTag = new ImageLabel();
                CombinedTag.Anchor = AnchorStyles.Left;
                CombinedTag.Font = Utility.Configuration.Config.UI.MainFont;
                CombinedTag.Margin = new Padding( 3, 2, 3, 2 );
                CombinedTag.ImageList = ResourceManager.Instance.Icons;
                CombinedTag.ImageIndex = (int)ResourceManager.IconContent.FleetCombined;
                CombinedTag.Text = "-";
                CombinedTag.Visible = false;

                TableFleet.Controls.Add( CombinedTag, 1, 4 );

                #region set RowStyle
                RowStyle rs = new RowStyle( SizeType.AutoSize, 0 );

                if ( TableFleet.RowStyles.Count > 4 )
                    TableFleet.RowStyles[4] = rs;
                else
                    while ( TableFleet.RowStyles.Count <= 4 )
                        TableFleet.RowStyles.Add( rs );
                #endregion

            }
            #endregion

            Icon = ResourceManager.ImageToIcon( ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormFleet] );

            Utility.SystemEvents.UpdateTimerTick += UpdateTimerTick;
        }
Пример #19
0
        public void InitOnce(TableLayoutPanel grid, ViewModel viewModel)
        {
            _Grid = grid;
            _Style = new RowStyle(SizeType.Absolute, 27F);

            Dock = DockStyle.Fill;

            _Label = new Label();
            _Label.TextAlign = ContentAlignment.MiddleRight;
            _Label.Dock = DockStyle.Fill;

            TbData.GotFocus += new EventHandler(TbData_GotFocus);

            BtFill.Image = viewModel.GetImage("att-data-options");
            _Body.ShowTips(BtFill, "选项");
            BtCopy.Image = viewModel.GetImage("att-copy");
            _Body.ShowTips(BtCopy, "复制");
            BtFill.Image = viewModel.GetImage("script-fill-16");
            _Body.ShowTips(BtFill, "填充");
        }
Пример #20
0
        /// <summary>
        /// init_layout( )
        /// </summary>
        private void init_layout( )
        {
            this._layout_table.Name        = "_layout_table";
            this._layout_table.ColumnCount = form_report_catch._LAYOUT_COLS_;
            for (int i = 0; i < form_report_catch._LAYOUT_COLS_; ++i)
            {
                this._layout_table.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle( ));
            }
            this._layout_table.RowCount = form_report_catch._LAYOUT_ROWS_;
            for (int i = 0; i < form_report_catch._LAYOUT_ROWS_; ++i)
            {
                System.Windows.Forms.RowStyle row_style = new System.Windows.Forms.RowStyle( );
                row_style.SizeType = SizeType.Percent;
                row_style.Height   = this._ROW_HEIGHT_[i];
                this._layout_table.RowStyles.Add(row_style);
            }
            this._layout_table.Dock     = DockStyle.Fill;
            this._layout_table.TabIndex = 0;

            this.Controls.Add(this._layout_table);
        }
Пример #21
0
        public void Init(IEngine engine)
        {
            _DefStyle = new RowStyle(SizeType.Percent, 100F);
            _UcList = new List<IInput>();

            string file = Path.Combine(_UserModel.Home, "ASql-Pdf.xml");
            if (!File.Exists(file))
            {
                return;
            }
            XmlDocument doc = new XmlDocument();
            doc.Load(file);

            Dml sql;
            foreach (XmlNode node in doc.SelectNodes("/Amon/Sqls/Sql"))
            {
                sql = new Dml();
                sql.Load(node);
                CbSqlList.Items.Add(sql);
            }
        }
Пример #22
0
        public void InitOnce(TableLayoutPanel grid, ViewModel viewModel)
        {
            _Grid = grid;
            _ViewModel = viewModel;
            _Style = new RowStyle(SizeType.Absolute, 27F);

            Dock = DockStyle.Fill;

            _Label = new Label();
            _Label.TextAlign = ContentAlignment.MiddleRight;
            _Label.Dock = DockStyle.Fill;

            TbData.GotFocus += new EventHandler(TbData_GotFocus);

            BtMod.Image = viewModel.GetImage(TbData.UseSystemPasswordChar ? "att-pass-hide" : "att-pass-show");
            _Body.ShowTips(BtMod, TbData.UseSystemPasswordChar ? "显示口令" : "隐藏口令");
            BtCopy.Image = viewModel.GetImage("att-copy");
            _Body.ShowTips(BtCopy, "复制");
            BtFill.Image = viewModel.GetImage("script-fill-16");
            _Body.ShowTips(BtFill, "填充");
        }
        //Add Row to DataGridView
        private void AddRow(VO2MaxStage Stage, VO2MaxSet Set)
        {
            tlpOverview.Size = new Size(tlpOverview.Size.Width, tlpOverview.Size.Height + 37);

            int index = tlpOverview.RowCount++;
            RowStyle style = new RowStyle(SizeType.Absolute, 35);
            tlpOverview.RowStyles.Add(style);

            Label dgvLabel0 = CreateLabel();
            dgvLabel0.Text = Stage.StageName.ToString();
            tlpOverview.Controls.Add(dgvLabel0, 0, index);

            Label dgvLabel1 = CreateLabel();
            dgvLabel1.Text = Set.SetNumber.ToString() + " / " + Stage.VO2MaxSetCollection.Count.ToString();
            tlpOverview.Controls.Add(dgvLabel1, 1, index);

            Label dgvLabel2 = CreateLabel();
            dgvLabel2.Text = Set.Direction;
            tlpOverview.Controls.Add(dgvLabel2, 2, index);

            Label dgvLabel3 = CreateLabel();
            string formatString = @"mm\:ss";
            dgvLabel3.Text = Set.TimeRemaining.ToString(formatString);
            tlpOverview.Controls.Add(dgvLabel3, 3, index);

            Label dgvLabel4 = CreateLabel();
            dgvLabel4.Text = Set.Contraction;
            tlpOverview.Controls.Add(dgvLabel4, 4, index);

            Label dgvLabel5 = CreateLabel();
            dgvLabel5.Text = Set.Legs;
            tlpOverview.Controls.Add(dgvLabel5, 5, index);

            Label dgvLabel6 = CreateLabel();
            dgvLabel6.Text = Set.Position;
            tlpOverview.Controls.Add(dgvLabel6, 6, index);
        }
Пример #24
0
 /// <include file='doc\TableLayoutSettings.uex' path='docs/doc[@for="RowStyleCollection.Add"]/*' />
 public int Add(RowStyle rowStyle)
 {
     return(((IList)this).Add(rowStyle));
 }
        private void btnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (barEditItem1.EditValue == null || barEditItem2.EditValue == null)
            {
                XtraMessageBox.Show("请指定明确的楼层与区域.", "错误提示");
                return;
            }

            splashScreenManager1.ShowWaitForm();

            if (tableLayoutPanel1 != null)
            {
                groupControl3.Controls.Remove(tableLayoutPanel1);
                tableLayoutPanel1.Dispose();
            }

            try
            {
                tableLayoutPanel1 = new TableLayoutPanel();
                tableLayoutPanel1.BackColor = Color.White;
                tableLayoutPanel1.Dock = DockStyle.Fill;
                tableLayoutPanel1.AutoScroll = true;
                tableLayoutPanel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(tableLayoutPanel1, true, null);
                this.groupControl3.Controls.Add(tableLayoutPanel1);

                dt = monthCalendar1.SelectionStart;
                iPeroid = radioGroup1.SelectedIndex;
                iFloorId = Convert.ToDecimal(barEditItem1.EditValue);
                iAreaId = Convert.ToDecimal(barEditItem2.EditValue);

                List<MACHINE_SCHEDULE> lstMc1 = db.Fetch<MACHINE_SCHEDULE>("where SCHEDULE_TIME = @0 and SCHEEDULE_PERIOD = @1 and FLOOR_ID = @2 and AREA_ID = @3",
                    new object[] { monthCalendar1.SelectionStart, radioGroup1.SelectedIndex, barEditItem1.EditValue, barEditItem2.EditValue });

                List<MACHINE_INFO> lstInfo = db.Fetch<MACHINE_INFO>("where FLOOR_ID = @0 and AREA_ID = @1 order by BED_NO", new object[] { barEditItem1.EditValue, barEditItem2.EditValue });
                MACHINE_LAYOUT mL = db.SingleOrDefault<MACHINE_LAYOUT>("where floorid = @0 and areaid = @1", new object[] { barEditItem1.EditValue, barEditItem2.EditValue });

                int iRow = 0;                                                                                   // 行数
                int iCol = 0;                                                                                   // 列数
                int iCount = 0;                                                                                 // 透析机总数
                if (lstInfo != null && lstInfo.Count > 0 && mL != null)
                {
                    iRow = Convert.ToInt32(mL.ROOMROWS);
                    iCol = Convert.ToInt32(Math.Ceiling((decimal)lstInfo.Count / (decimal)mL.ROOMROWS));        // 向上取整
                    iCount = lstInfo.Count;

                    tableLayoutPanel1.Controls.Clear();
                    tableLayoutPanel1.Size = new System.Drawing.Size(0, 0);
                    tableLayoutPanel1.AutoSize = true;
                    tableLayoutPanel1.RowStyles.Clear();

                    tableLayoutPanel1.Controls.Clear();
                    tableLayoutPanel1.RowCount = iRow;
                    tableLayoutPanel1.ColumnCount = iCol;

                    tableLayoutPanel1.ColumnStyles.Clear();
                    for (int i = 0; i < iRow; i++)
                    {
                        RowStyle rs = new RowStyle();
                        rs.SizeType = SizeType.Percent;
                        tableLayoutPanel1.RowStyles.Add(rs);
                    }

                    for (int i = 0; i < iCol; i++)
                    {
                        ColumnStyle cs = new ColumnStyle();
                        cs.SizeType = SizeType.AutoSize;
                        tableLayoutPanel1.ColumnStyles.Add(cs);
                    }

                    int iCnt = 0;
                    for (int r = 0; r < iRow; r++)
                    {
                        for (int c = 0; c < iCol; c++)
                        {
                            if (iCnt < iCount)
                            {
                                // 生成控件
                                UcDialysis uc = new UcDialysis(lstPatientReg, lstPatientBaseInfo, dt, iFloorId, iAreaId, iPeroid, iFrmType);
                                uc.No = lstInfo[iCnt].BED_NO;
                                uc.Model = lstInfo[iCnt].MODEL;
                                uc.M_Type = lstInfo[iCnt].MACHINETYPE;
                                uc.SN = lstInfo[iCnt].SN;
                                uc.InfoID = lstInfo[iCnt].ID;

                                // 获取该设备的图片
                                MACHINE_TYPE mType = db.SingleOrDefault<MACHINE_TYPE>("where MODEL = @0 AND M_TYPE = @1", new object[] { lstInfo[iCnt].MODEL, lstInfo[iCnt].MACHINETYPE });
                                if (mType != null && mType.M_PICTURE != null && mType.M_PICTURE.Length > 0)
                                    uc.Pict = mType.M_PICTURE;

                                // 根据不同功能,控件按钮全能
                                switch (iFrmType)
                                {
                                    case 0:
                                        {
                                            uc.StatusOP = false;
                                            uc.CheckIn = false;
                                            uc.Maintence = false;
                                            uc.Idel = false;
                                            break;
                                        }
                                    case 1:
                                        {
                                            uc.StatusOP = false;
                                            uc.Maintence = false;
                                            uc.SearchPt = false;
                                            uc.Idel = false;
                                            break;
                                        }
                                    case 2:
                                        {
                                            uc.StatusOP = false;
                                            uc.SearchPt = false;
                                            uc.CheckIn = false;
                                            break;
                                        }
                                }

                                // 加载预约/签到/维护等信息
                                var v = lstMc1.Where(s => s.BED_NO == lstInfo[iCnt].BED_NO).FirstOrDefault<MACHINE_SCHEDULE>();
                                if (v != null)
                                {
                                    if (v.MACHINE_STATUS != null)
                                        uc.Status = (decimal?)v.MACHINE_STATUS;
                                    else
                                        uc.Status = 74;                                     // 空闲
                                    uc.PtNo = Convert.ToInt32(v.PT_ID);
                                    uc.ScheduleID = v.ID;
                                    uc.CheckInTime = v.CHCKINTM;
                                    uc.ReservTm = v.RESERVATION;
                                }
                                else
                                {
                                    uc.Status = 74;
                                    uc.PtNo = null;
                                }
                                try
                                {
                                    tableLayoutPanel1.Controls.Add(uc);
                                }
                                catch (Exception err)
                                {
                                    Console.WriteLine(err.Message);
                                }

                            }
                            iCnt++;
                        }
                    }
                }
                else
                    tableLayoutPanel1.Controls.Clear();
            }
            catch(Exception err)
            {
                splashScreenManager1.CloseWaitForm();
                MessageBox.Show("未知错误. 错误原因: " + err.Message, "错误提示",  MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            splashScreenManager1.CloseWaitForm();
        }
		public void Remove (RowStyle rowStyle)
		{
			((IList)this).Remove (rowStyle);
		}
		public void Insert (int index, RowStyle rowStyle)
		{
			((IList)this).Insert (index, rowStyle);
		}
		public int IndexOf (RowStyle rowStyle)
		{
			return ((IList)this).IndexOf (rowStyle);
		}
Пример #29
0
 /// <include file='doc\TableLayoutSettings.uex' path='docs/doc[@for="RowStyleCollection.Contains"]/*' />
 public bool Contains(RowStyle rowStyle)
 {
     return(((IList)this).Contains(rowStyle));
 }
		public int Add (RowStyle rowStyle)
		{
			return base.Add (rowStyle);
		}
 protected virtual void OnSpringTableLayoutCore()
 {
     if (this.LayoutStyle == ToolStripLayoutStyle.Table)
     {
         this.state[stateCalledSpringTableLayout] = true;
         base.SuspendLayout();
         if (this.lastOrientation != base.Orientation)
         {
             System.Windows.Forms.TableLayoutSettings tableLayoutSettings = this.TableLayoutSettings;
             tableLayoutSettings.RowCount    = 0;
             tableLayoutSettings.ColumnCount = 0;
             tableLayoutSettings.ColumnStyles.Clear();
             tableLayoutSettings.RowStyles.Clear();
         }
         this.lastOrientation = base.Orientation;
         if (base.Orientation == Orientation.Horizontal)
         {
             this.TableLayoutSettings.GrowStyle = TableLayoutPanelGrowStyle.AddColumns;
             int count = this.TableLayoutSettings.ColumnStyles.Count;
             for (int i = 0; i < this.DisplayedItems.Count; i++)
             {
                 if (i >= count)
                 {
                     this.TableLayoutSettings.ColumnStyles.Add(new ColumnStyle());
                 }
                 ToolStripStatusLabel label = this.DisplayedItems[i] as ToolStripStatusLabel;
                 bool flag = (label != null) && label.Spring;
                 this.DisplayedItems[i].Anchor = flag ? (AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top) : (AnchorStyles.Bottom | AnchorStyles.Top);
                 ColumnStyle style = this.TableLayoutSettings.ColumnStyles[i];
                 style.Width    = 100f;
                 style.SizeType = flag ? SizeType.Percent : SizeType.AutoSize;
             }
             if ((this.TableLayoutSettings.RowStyles.Count > 1) || (this.TableLayoutSettings.RowStyles.Count == 0))
             {
                 this.TableLayoutSettings.RowStyles.Clear();
                 this.TableLayoutSettings.RowStyles.Add(new RowStyle());
             }
             this.TableLayoutSettings.RowCount = 1;
             this.TableLayoutSettings.RowStyles[0].SizeType = SizeType.Absolute;
             this.TableLayoutSettings.RowStyles[0].Height   = Math.Max(0, this.DisplayRectangle.Height);
             this.TableLayoutSettings.ColumnCount           = this.DisplayedItems.Count + 1;
             for (int j = this.DisplayedItems.Count; j < this.TableLayoutSettings.ColumnStyles.Count; j++)
             {
                 this.TableLayoutSettings.ColumnStyles[j].SizeType = SizeType.AutoSize;
             }
         }
         else
         {
             this.TableLayoutSettings.GrowStyle = TableLayoutPanelGrowStyle.AddRows;
             int num4 = this.TableLayoutSettings.RowStyles.Count;
             for (int k = 0; k < this.DisplayedItems.Count; k++)
             {
                 if (k >= num4)
                 {
                     this.TableLayoutSettings.RowStyles.Add(new RowStyle());
                 }
                 ToolStripStatusLabel label2 = this.DisplayedItems[k] as ToolStripStatusLabel;
                 bool flag2 = (label2 != null) && label2.Spring;
                 this.DisplayedItems[k].Anchor = flag2 ? (AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top) : (AnchorStyles.Right | AnchorStyles.Left);
                 RowStyle style2 = this.TableLayoutSettings.RowStyles[k];
                 style2.Height   = 100f;
                 style2.SizeType = flag2 ? SizeType.Percent : SizeType.AutoSize;
             }
             this.TableLayoutSettings.ColumnCount = 1;
             if ((this.TableLayoutSettings.ColumnStyles.Count > 1) || (this.TableLayoutSettings.ColumnStyles.Count == 0))
             {
                 this.TableLayoutSettings.ColumnStyles.Clear();
                 this.TableLayoutSettings.ColumnStyles.Add(new ColumnStyle());
             }
             this.TableLayoutSettings.ColumnCount = 1;
             this.TableLayoutSettings.ColumnStyles[0].SizeType = SizeType.Absolute;
             this.TableLayoutSettings.ColumnStyles[0].Width    = Math.Max(0, this.DisplayRectangle.Width);
             this.TableLayoutSettings.RowCount = this.DisplayedItems.Count + 1;
             for (int m = this.DisplayedItems.Count; m < this.TableLayoutSettings.RowStyles.Count; m++)
             {
                 this.TableLayoutSettings.RowStyles[m].SizeType = SizeType.AutoSize;
             }
         }
         base.ResumeLayout(false);
     }
 }
Пример #32
0
		public void TestTableLayoutStyleOwned ()
		{
			try {
				ColumnStyle style = new ColumnStyle ();
				TableLayoutColumnStyleCollection coll = new TableLayoutPanel ().ColumnStyles;
				coll.Add (style);
				TableLayoutColumnStyleCollection coll2 = new TableLayoutPanel ().ColumnStyles;
				coll2.Add (style);
				Assert.Fail ("#1");
			} catch (ArgumentException ex) {
				// PASS
			}

			try {
				RowStyle style = new RowStyle ();
				TableLayoutRowStyleCollection coll = new TableLayoutPanel ().RowStyles;
				coll.Add (style);
				TableLayoutRowStyleCollection coll2 = new TableLayoutPanel ().RowStyles;
				coll2.Add (style);
				Assert.Fail ("#2");
			} catch (ArgumentException ex) {
				// PASS
			}
		}
Пример #33
0
            public void AddToTable( TableLayoutPanel table, int row )
            {
                table.SuspendLayout();
                table.Controls.Add( Name, 0, row );
                table.Controls.Add( Level, 1, row );
                table.Controls.Add( HP, 2, row );
                table.Controls.Add( Condition, 3, row );
                table.Controls.Add( ShipResource, 4, row );
                table.Controls.Add( Equipments, 5, row );
                table.ResumeLayout();

                #region set RowStyle
                RowStyle rs = new RowStyle( SizeType.Absolute, 21 );

                if ( table.RowStyles.Count > row )
                    table.RowStyles[row] = rs;
                else
                    while ( table.RowStyles.Count <= row )
                        table.RowStyles.Add( rs );
                #endregion
            }
Пример #34
0
 /// <include file='doc\TableLayoutSettings.uex' path='docs/doc[@for="RowStyleCollection.Insert"]/*' />
 public void Insert(int index, RowStyle rowStyle)
 {
     ((IList)this).Insert(index, rowStyle);
 }
		public bool Contains (RowStyle rowStyle)
		{
			return ((IList)this).Contains (rowStyle);
		}
Пример #36
0
 /// <include file='doc\TableLayoutSettings.uex' path='docs/doc[@for="RowStyleCollection.Remove"]/*' />
 public void Remove(RowStyle rowStyle)
 {
     ((IList)this).Remove(rowStyle);
 }
Пример #37
0
        /// <devdoc>
        /// Override this function if you want to do custom table layouts for the
        /// StatusStrip.  The default layoutstyle is tablelayout, and we need to play
        /// with the row/column styles
        /// </devdoc>
        protected virtual void OnSpringTableLayoutCore()
        {
            if (this.LayoutStyle == ToolStripLayoutStyle.Table)
            {
                state[stateCalledSpringTableLayout] = true;

                this.SuspendLayout();

                if (lastOrientation != Orientation)
                {
                    TableLayoutSettings settings = this.TableLayoutSettings;
                    settings.RowCount    = 0;
                    settings.ColumnCount = 0;
                    settings.ColumnStyles.Clear();
                    settings.RowStyles.Clear();
                }
                lastOrientation = Orientation;

                if (Orientation == Orientation.Horizontal)
                {
                    //
                    // Horizontal layout
                    //
                    TableLayoutSettings.GrowStyle = TableLayoutPanelGrowStyle.AddColumns;

                    int originalColumnCount = this.TableLayoutSettings.ColumnStyles.Count;

                    // iterate through the elements which are going to be displayed.
                    for (int i = 0; i < this.DisplayedItems.Count; i++)
                    {
                        if (i >= originalColumnCount)
                        {
                            // add if it's necessary.
                            this.TableLayoutSettings.ColumnStyles.Add(new ColumnStyle());
                        }

                        // determine if we "spring" or "autosize" the column
                        ToolStripStatusLabel panel = DisplayedItems[i] as ToolStripStatusLabel;
                        bool spring = (panel != null && panel.Spring);
                        DisplayedItems[i].Anchor = (spring) ? AllAnchor : VerticalAnchor;

                        // spring is achieved by using 100% as the column style
                        ColumnStyle colStyle = this.TableLayoutSettings.ColumnStyles[i];
                        colStyle.Width    = 100; // this width is ignored in AutoSize.
                        colStyle.SizeType = (spring) ? SizeType.Percent : SizeType.AutoSize;
                    }

                    if (TableLayoutSettings.RowStyles.Count > 1 || TableLayoutSettings.RowStyles.Count == 0)
                    {
                        TableLayoutSettings.RowStyles.Clear();
                        TableLayoutSettings.RowStyles.Add(new RowStyle());
                    }
                    TableLayoutSettings.RowCount = 1;

                    TableLayoutSettings.RowStyles[0].SizeType = SizeType.Absolute;
                    TableLayoutSettings.RowStyles[0].Height   = Math.Max(0, this.DisplayRectangle.Height);
                    TableLayoutSettings.ColumnCount           = DisplayedItems.Count + 1; // add an extra cell so it fills the remaining space

                    // dont remove the extra column styles, just set them back to autosize.
                    for (int i = DisplayedItems.Count; i < TableLayoutSettings.ColumnStyles.Count; i++)
                    {
                        this.TableLayoutSettings.ColumnStyles[i].SizeType = SizeType.AutoSize;
                    }
                }
                else
                {
                    //
                    // Vertical layout
                    //

                    TableLayoutSettings.GrowStyle = TableLayoutPanelGrowStyle.AddRows;

                    int originalRowCount = this.TableLayoutSettings.RowStyles.Count;

                    // iterate through the elements which are going to be displayed.
                    for (int i = 0; i < this.DisplayedItems.Count; i++)
                    {
                        if (i >= originalRowCount)
                        {
                            // add if it's necessary.
                            this.TableLayoutSettings.RowStyles.Add(new RowStyle());
                        }

                        // determine if we "spring" or "autosize" the row
                        ToolStripStatusLabel panel = DisplayedItems[i] as ToolStripStatusLabel;
                        bool spring = (panel != null && panel.Spring);
                        DisplayedItems[i].Anchor = (spring) ? AllAnchor : HorizontalAnchor;

                        // spring is achieved by using 100% as the row style
                        RowStyle rowStyle = this.TableLayoutSettings.RowStyles[i];
                        rowStyle.Height   = 100; // this width is ignored in AutoSize.
                        rowStyle.SizeType = (spring) ? SizeType.Percent : SizeType.AutoSize;
                    }
                    TableLayoutSettings.ColumnCount = 1;

                    if (TableLayoutSettings.ColumnStyles.Count > 1 || TableLayoutSettings.ColumnStyles.Count == 0)
                    {
                        TableLayoutSettings.ColumnStyles.Clear();
                        TableLayoutSettings.ColumnStyles.Add(new ColumnStyle());
                    }

                    TableLayoutSettings.ColumnCount = 1;
                    TableLayoutSettings.ColumnStyles[0].SizeType = SizeType.Absolute;
                    TableLayoutSettings.ColumnStyles[0].Width    = Math.Max(0, this.DisplayRectangle.Width);

                    TableLayoutSettings.RowCount = DisplayedItems.Count + 1; // add an extra cell so it fills the remaining space

                    // dont remove the extra column styles, just set them back to autosize.
                    for (int i = DisplayedItems.Count; i < TableLayoutSettings.RowStyles.Count; i++)
                    {
                        this.TableLayoutSettings.RowStyles[i].SizeType = SizeType.AutoSize;
                    }
                }

                this.ResumeLayout(false);
            }
        }
Пример #38
0
 /// <include file='doc\TableLayoutSettings.uex' path='docs/doc[@for="RowStyleCollection.IndexOf"]/*' />
 public int IndexOf(RowStyle rowStyle)
 {
     return(((IList)this).IndexOf(rowStyle));
 }
Пример #39
0
 public int Add(RowStyle rowStyle)
 {
     return(base.Add(rowStyle));
 }