Beispiel #1
0
        private void questionClick(object sender, System.EventArgs e)
        {
            ImageButton ibtn = (ImageButton)sender;
            int         row  = tableLayoutPanel1.GetRow(ibtn);

            if (FrameInfoDialog.Show(ParentForm, frames[row])
                == DialogResult.OK)
            {
                validName(frames[row]);
                tableLayoutPanel1.GetControlFromPosition(0, row)
                .Text = frames[row].Name;
            }
        }
        public static DialogResult Show(IWin32Window Owner, Frame f)
        {
            FrameInfoDialog fid = new FrameInfoDialog
            {
                frame = f
            };

            int i = 0;

            fid.xdisp.Text = "db ";
            fid.ydisp.Text = "db ";
            fid.props.Text = "db ";
            fid.tiles.Text = "db ";
            fid.sizes.Text = "db ";

            foreach (TileMask t in f.Tiles)
            {
                if (i % 12 == 0 && i != 0)
                {
                    fid.xdisp.Text = fid.xdisp.Text.Remove(fid.xdisp.Text.Length - 1, 1);
                    fid.ydisp.Text = fid.ydisp.Text.Remove(fid.ydisp.Text.Length - 1, 1);
                    fid.props.Text = fid.props.Text.Remove(fid.props.Text.Length - 1, 1);
                    fid.tiles.Text = fid.tiles.Text.Remove(fid.tiles.Text.Length - 1, 1);
                    fid.sizes.Text = fid.sizes.Text.Remove(fid.sizes.Text.Length - 1, 1);

                    fid.xdisp.Text += Environment.NewLine + "db ";
                    fid.ydisp.Text += Environment.NewLine + "db ";
                    fid.props.Text += Environment.NewLine + "db ";
                    fid.tiles.Text += Environment.NewLine + "db ";
                    fid.sizes.Text += Environment.NewLine + "db ";
                }
                fid.xdisp.Text += t.XDispString + ",";
                fid.ydisp.Text += t.YDispString + ",";
                fid.props.Text += t.Properties + ",";
                fid.tiles.Text += t.Tile + ",";
                fid.sizes.Text += t.SizeString + ",";
                i++;
            }
            if (fid.xdisp.Text[fid.xdisp.Text.Length - 1] == ',')
            {
                fid.xdisp.Text = fid.xdisp.Text.Remove(fid.xdisp.Text.Length - 1, 1);
                fid.ydisp.Text = fid.ydisp.Text.Remove(fid.ydisp.Text.Length - 1, 1);
                fid.props.Text = fid.props.Text.Remove(fid.props.Text.Length - 1, 1);
                fid.tiles.Text = fid.tiles.Text.Remove(fid.tiles.Text.Length - 1, 1);
                fid.sizes.Text = fid.sizes.Text.Remove(fid.sizes.Text.Length - 1, 1);
            }

            fid.name.Text = f.Name;

            return(fid.ShowDialog(Owner));
        }