コード例 #1
0
 public static void PageType_MouseClick(object sender, MouseEventArgs e)
 {
     for (int i = DraggableObjects.Count - 1; i >= 0; i--)
     {
         if (DraggableObjects[i].Region.Contains(e.Location))
         {
             if (i != control_Num)
             {
                 DraggableObjects[control_Num].Setimage = LinBox(
                     DraggableObjects[control_Num].Region.Width,
                     DraggableObjects[control_Num].Region.Height,
                     0,
                     DraggableObjects[control_Num].ControlType, control_Num
                     );
                 control_Num = i;
                 DraggableObjects[i].Setimage = LinBox(
                     DraggableObjects[i].Region.Width,
                     DraggableObjects[i].Region.Height,
                     1,
                     DraggableObjects[i].ControlType, i
                     );
                 Print_PageType.Invalidate();
                 RBuild_Info.set_Info(DraggableObjects[control_Num].ControlType);
                 break;
             }
             else
             {
                 break;
             }
         }
     }
 }
コード例 #2
0
    private void acceptSet_Click(object sender, EventArgs e)
    {
        Label pL = (Label)sender;

        if ((int)pL.Tag == 0)
        {
            if (input_info[4].textBox.Text == "")
            {
                CloseLink(data_Pool.data_Type);
                data_Pool.data_Type = 0;
            }
            else
            {
                data_Pool.data_Type         = _link;
                data_Pool.data_UserName     = input_info[0].textBox.Text;
                data_Pool.data_Pasword      = input_info[1].textBox.Text;
                data_Pool.data_connectionIP = input_info[2].textBox.Text;
                data_Pool.data_DataName     = input_info[3].textBox.Text;
                data_Pool.data_SQL          = inputSQL.textBox.Text;

                Sql_Select = inputSQL.textBox.Text;
            }
            RBuild_Info.Set_CompositeLocation();
        }
        setData_Form._formObject.Close();
    }
コード例 #3
0
 /// <summary>
 /// 删除组件
 /// </summary>
 /// <param name="_mode">是否记录</param>
 public static void Delete_Control(bool _record)
 {
     if (DraggableObjects.Count > 0)
     {
         DraggableObjects.Remove(DraggableObjects[control_Num]);
         if (DraggableObjects.Count < 1)
         {
             control_Num = -1;
             RBuild_Info.Set_DefaultInfo();
         }
         else
         {
             control_Num -= 1;
             if (control_Num < 0)
             {
                 control_Num = 0;
             }
             DraggableObjects[control_Num].Setimage = LinBox(DraggableObjects[control_Num].Region.Width, DraggableObjects[control_Num].Region.Height, 1, DraggableObjects[control_Num].ControlType, control_Num);
             RBuild_Info.set_Info(DraggableObjects[control_Num].ControlType);
             DraggableObjects[control_Num].IsDragging = false;
             if (_record)
             {
                 Object_Record();
             }
         }
         page_Install.Invalidate();
         page_Container.Invalidate();
         Print_PageType.Invalidate();
         RBuild_MouseEvent.CursorFlag = -1;
         ReportChange_Flag            = true;
     }
 }
コード例 #4
0
    /// <summary>
    /// 粘贴组件
    /// </summary>
    /// <param name="lx">粘贴位置 x</param>
    /// <param name="ly">粘贴位置 y</param>
    public static void Object_OperationPast(int lx, int ly)
    {
        if ((operationObject.Id != null) && (band_Num != -1))
        {
            if (control_Num > -1)
            {
                DraggableObjects[control_Num].Setimage = LinBox(
                    DraggableObjects[control_Num].Region.Width,
                    DraggableObjects[control_Num].Region.Height,
                    0,
                    DraggableObjects[control_Num].ControlType, control_Num
                    );
            }
            operationObject.Region = new Rectangle(
                DraggableBandObjects[band_Num].Region.Left + lx,
                DraggableBandObjects[band_Num].Region.Top + ly,
                operationObject.Region.Width,
                operationObject.Region.Height
                );
            Draggable draggableBlock = new Draggable(operationObject.Region.Left, operationObject.Region.Top, operationObject.ControlType);

            draggableBlock.Id                  = GetMd5Str16(DateTime.Now.ToString());
            draggableBlock.Belong_Band         = band_Num;
            draggableBlock.Region              = operationObject.Region;
            draggableBlock.Setimage            = operationObject.Setimage;
            draggableBlock.isContent           = operationObject.isContent;
            draggableBlock.Field_Img           = operationObject.Field_Img;
            draggableBlock.Field_Text          = operationObject.Field_Text;
            draggableBlock.Field_Calculate     = operationObject.Field_Calculate;
            draggableBlock.Field_TextFont      = operationObject.Field_TextFont;
            draggableBlock.Field_TextFontSize  = operationObject.Field_TextFontSize;
            draggableBlock.Field_TextFontStyle = operationObject.Field_TextFontStyle;
            draggableBlock.Field_Align         = operationObject.Field_Align;
            draggableBlock.Field_ImgZoom       = operationObject.Field_ImgZoom;
            for (int i = 0; i < 8; i++)
            {
                draggableBlock.Field_BoxLine[i] = operationObject.Field_BoxLine[i];
            }
            draggableBlock.Field_LineColor     = operationObject.Field_LineColor;
            draggableBlock.Field_LineThickness = operationObject.Field_LineThickness;
            draggableBlock.Field_LineType      = operationObject.Field_LineType;
            draggableBlock.Field_Shape         = operationObject.Field_Shape;
            draggableBlock.Field_ControlColor  = operationObject.Field_ControlColor;
            draggableBlock.Field_BackColor     = operationObject.Field_BackColor;

            control_Num = DraggableObjects.Count;
            DraggableObjects.Add(draggableBlock);
            Print_PageType.Invalidate();
            Object_Record();
            RBuild_Info.set_Info(DraggableObjects[control_Num].ControlType);
            ReportChange_Flag = true;
        }
    }
コード例 #5
0
 /// <summary>
 /// 绘制图像
 /// </summary>
 /// <param name="gImage">画笔</param>
 /// <param name="_controlNum">组件序号</param>
 private static void Draw_Image(Graphics gImage, int _controlNum)
 {
     if (DraggableObjects[_controlNum].isContent)
     {
         if (DraggableObjects[_controlNum].Field_ImgZoom == 1)
         {
             gImage.DrawImage(DraggableObjects[_controlNum].Field_Img, 3, 3, DraggableObjects[_controlNum].Region.Width - 7, DraggableObjects[_controlNum].Region.Height - 7);
         }
         else
         {
             Point point_img = RBuild_Info.ImagePoint(_controlNum, DraggableObjects[_controlNum].Region.Width - 7, DraggableObjects[_controlNum].Region.Height - 7);
             var   desRect   = new Rectangle(point_img.X + 3, point_img.Y + 3, DraggableObjects[_controlNum].Region.Width - 7, DraggableObjects[_controlNum].Region.Height - 7);
             var   srcRect   = new Rectangle(0, 0, DraggableObjects[_controlNum].Region.Width - 7, DraggableObjects[_controlNum].Region.Height - 7);
             gImage.DrawImage(DraggableObjects[_controlNum].Field_Img, desRect, srcRect, GraphicsUnit.Pixel);
         }
     }
 }
コード例 #6
0
    /// <summary>
    /// 绘制文字
    /// </summary>
    /// <param name="gString">画笔</param>
    /// <param name="_controlNum">组件序号</param>
    private static void Draw_Text(Graphics gString, int _controlNum)
    {
        if (DraggableObjects[_controlNum].isContent)
        {
            RbControls_DrawTextMethod DrawText = new RbControls_DrawTextMethod();

            string _txt = DraggableObjects[_controlNum].Field_Text;
            if (DraggableObjects[_controlNum].ControlType == 4)
            {
                _txt = "[\"" + _txt + "\"]";
            }

            Font     fnt_Text   = new Font(DraggableObjects[_controlNum].Field_TextFont, DraggableObjects[_controlNum].Field_TextFontSize, DraggableObjects[_controlNum].Field_TextFontStyle, GraphicsUnit.Pixel);
            Bitmap   bmp_Text   = new Bitmap(DraggableObjects[_controlNum].Region.Width - 7, DraggableObjects[_controlNum].Region.Height - 7);
            Graphics gText      = Graphics.FromImage(bmp_Text);
            Point    point_text = RBuild_Info.TextPoint(_controlNum, bmp_Text.Width, bmp_Text.Height, gText, _txt, fnt_Text);
            DrawText.DrawString(bmp_Text, _txt, fnt_Text, DraggableObjects[_controlNum].Field_ControlColor, new Rectangle(point_text.X, point_text.Y, bmp_Text.Width, bmp_Text.Height));
            DraggableObjects[_controlNum].Field_Img = bmp_Text;
            gString.DrawImage(DraggableObjects[_controlNum].Field_Img, 3, 3, bmp_Text.Width, bmp_Text.Height);
        }
    }
コード例 #7
0
    // 打开文件
    public static void Open_File()
    {
        OpenFileDialog ofd = new OpenFileDialog();

        ofd.Filter           = "报表文件(*.rpt)|*.rpt";
        ofd.FilterIndex      = 1;
        ofd.RestoreDirectory = true;

        if (ofd.ShowDialog() == DialogResult.OK)
        {
            if (ReportChange_Flag)
            {
                DialogResult _save = MessageBox.Show("是否保存报表文件?", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                if (_save.ToString().Equals("Yes"))
                {
                    Save_File();
                }
                if (_save.ToString().Equals("Cancel"))
                {
                    return;
                }
            }
            SerializerObject.Clear();
            string localFilePath = ofd.FileName.ToString();
            ReportFile_Name.Text = localFilePath;
            try
            {
                SerializerObject = Serializer.FileToObject <List <OperationObject> >(localFilePath);

                DraggableObjects.Clear();
                recordObjects.Clear();
                control_Num = -1;

                int _select = 0;
                for (int i = 0; i < SerializerObject.Count; i++)
                {
                    Draggable draggableBlock = new Draggable(SerializerObject[i].Region.Left, SerializerObject[i].Region.Top, SerializerObject[i].ControlType);
                    draggableBlock.Id          = SerializerObject[i].Id;
                    draggableBlock.Belong_Band = SerializerObject[i].Belong_Band;
                    draggableBlock.Region      = SerializerObject[i].Region;
                    draggableBlock.isContent   = SerializerObject[i].isContent;
                    if (SerializerObject[i].ControlType == 2)
                    {
                        draggableBlock.Field_Img = Base64StringToImage(SerializerObject[i].Field_ImgBase64);
                    }
                    draggableBlock.Field_Text          = SerializerObject[i].Field_Text;
                    draggableBlock.Field_Calculate     = SerializerObject[i].Field_Calculate;
                    draggableBlock.Field_TextFont      = SerializerObject[i].Field_TextFont;
                    draggableBlock.Field_TextFontSize  = SerializerObject[i].Field_TextFontSize;
                    draggableBlock.Field_TextFontStyle = (FontStyle)Enum.Parse(typeof(FontStyle), SerializerObject[i].Field_TextFontStyleString);
                    draggableBlock.Field_Align         = SerializerObject[i].Field_Align;
                    draggableBlock.Field_ImgZoom       = SerializerObject[i].Field_ImgZoom;
                    for (int t = 0; t < 8; t++)
                    {
                        draggableBlock.Field_BoxLine[t] = SerializerObject[i].Field_BoxLine[t];
                    }
                    draggableBlock.Field_LineColor     = ColorTranslator.FromHtml(SerializerObject[i].Field_LineColorString);
                    draggableBlock.Field_LineThickness = SerializerObject[i].Field_LineThickness;
                    draggableBlock.Field_LineType      = SerializerObject[i].Field_LineType;
                    draggableBlock.Field_Shape         = SerializerObject[i].Field_Shape;
                    draggableBlock.Field_ControlColor  = ColorTranslator.FromHtml(SerializerObject[i].Field_ControlColorString);
                    draggableBlock.Field_BackColor     = ColorTranslator.FromHtml(SerializerObject[i].Field_BackColorString);
                    DraggableObjects.Add(draggableBlock);

                    control_Num = i;
                    if (i == SerializerObject.Count - 1)
                    {
                        _select = 1;
                    }
                    DraggableObjects[i].Setimage = LinBox(SerializerObject[i].Region.Width, SerializerObject[i].Region.Height, _select, SerializerObject[i].ControlType, i);
                }

                page_TypeFace = SerializerObject[0].page_Type;
                _pgselect     = page_TypeFace.Page_Type;

                for (int i = 0; i < 3; i++)
                {
                    DraggableBandObjects[i].Region = SerializerObject[0].Band_Region[i];
                }

                Print_PageType.Size = page_TypeFace.Page_Area;

                int _iLeft = (page_Container.Width / 2) - (page_TypeFace.Page_Area.Width / 2);
                if (_iLeft < 0)
                {
                    _iLeft = 0;
                }
                page_Install.Size     = new Size(page_TypeFace.Page_Area.Width + 20, page_TypeFace.Page_Area.Height + 20);
                page_Install.Location = new Point(_iLeft, 0);

                // 设置预览页面大小
                PreViewPage_Area = new Size(page_TypeFace.Page_Area.Width, page_TypeFace.Page_Area.Height - 126);

                Print_PageType.Invalidate();
                RBuild_Info.set_Info(DraggableObjects[control_Num].ControlType);

                ReportChange_Flag = false;
            }

            catch
            {
                MessageBox.Show("报表打开错误!");
            }
        }
    }
コード例 #8
0
    /// <summary>
    /// 撤销、重做
    /// </summary>
    /// <param name="_mode">模式</param>
    public static void Object_Operation(int _mode)
    {
        bool Oper = false;

        if (_mode == 0) // 撤销
        {
            oper_Record -= 1;
            if (oper_Record < 0)
            {
                Oper        = false;
                oper_Record = 0;
            }
            else
            {
                Oper = true;
            }
        }
        else
        if (_mode == 1) // 重做
        {
            oper_Record += 1;
            if (oper_Record >= recordObjects.Count)
            {
                Oper        = false;
                oper_Record = recordObjects.Count - 1;
            }
            else
            {
                Oper = true;
            }
        }

        if (Oper)
        {
            DraggableObjects.Clear();
            for (int i = 0; i < recordObjects[oper_Record].Count; i++)
            {
                Draggable draggableBlock = new Draggable(recordObjects[oper_Record][i].Region.Left, recordObjects[oper_Record][i].Region.Top, recordObjects[oper_Record][i].ControlType);

                draggableBlock.Id                  = recordObjects[oper_Record][i].Id;
                draggableBlock.Belong_Band         = recordObjects[oper_Record][i].Belong_Band;
                draggableBlock.Region              = recordObjects[oper_Record][i].Region;
                draggableBlock.Setimage            = recordObjects[oper_Record][i].Setimage;
                draggableBlock.isContent           = recordObjects[oper_Record][i].isContent;
                draggableBlock.Field_Img           = recordObjects[oper_Record][i].Field_Img;
                draggableBlock.Field_Text          = recordObjects[oper_Record][i].Field_Text;
                draggableBlock.Field_Calculate     = recordObjects[oper_Record][i].Field_Calculate;
                draggableBlock.Field_TextFont      = recordObjects[oper_Record][i].Field_TextFont;
                draggableBlock.Field_TextFontSize  = recordObjects[oper_Record][i].Field_TextFontSize;
                draggableBlock.Field_TextFontStyle = recordObjects[oper_Record][i].Field_TextFontStyle;
                draggableBlock.Field_Align         = recordObjects[oper_Record][i].Field_Align;
                draggableBlock.Field_ImgZoom       = recordObjects[oper_Record][i].Field_ImgZoom;
                for (int t = 0; t < 8; t++)
                {
                    draggableBlock.Field_BoxLine[t] = recordObjects[oper_Record][i].Field_BoxLine[t];
                }
                draggableBlock.Field_LineColor     = recordObjects[oper_Record][i].Field_LineColor;
                draggableBlock.Field_LineThickness = recordObjects[oper_Record][i].Field_LineThickness;
                draggableBlock.Field_LineType      = recordObjects[oper_Record][i].Field_LineType;
                draggableBlock.Field_Shape         = recordObjects[oper_Record][i].Field_Shape;
                draggableBlock.Field_ControlColor  = recordObjects[oper_Record][i].Field_ControlColor;
                draggableBlock.Field_BackColor     = recordObjects[oper_Record][i].Field_BackColor;

                DraggableObjects.Add(draggableBlock);
            }
            control_Num = recordObjects[oper_Record][0].Num;
            for (int i = 0; i < 3; i++)
            {
                DraggableBandObjects[i].Region = recordObjects[oper_Record][0].Band_Region[i];
            }

            Print_PageType.Invalidate();
            RBuild_Info.set_Info(DraggableObjects[control_Num].ControlType);
            ReportChange_Flag = true;
        }
    }
コード例 #9
0
    public static void PageType_Click(object sender, EventArgs e)
    {
        PanelEx pL = (PanelEx)sender;

        bool is_band = false;

        for (int i = 0; i < 3; i++)
        {
            is_band = false;
            if ((A4location_XY.X >= 0) && (A4location_XY.X <= Print_PageType.Width) &&
                (A4location_XY.Y >= DraggableBandObjects[i].Region.Top + 20) && (A4location_XY.Y <= DraggableBandObjects[i].Region.Bottom - 20))
            {
                is_band = true;
                break;
            }
        }

        if ((control_Type != -1) && (is_band))
        {
            if (control_Num > -1)
            {
                DraggableObjects[control_Num].Setimage = LinBox(
                    DraggableObjects[control_Num].Region.Width,
                    DraggableObjects[control_Num].Region.Height,
                    0,
                    DraggableObjects[control_Num].ControlType, control_Num
                    );
            }
            Point _Location = A4location_XY;

            control_Num = DraggableObjects.Count;

            if ((_Location.X + 51) > Print_PageType.Width)
            {
                _Location.X = Print_PageType.Width - 51;
            }
            if ((_Location.Y + 51) > DraggableBandObjects[band_Num].Region.Bottom - 20)
            {
                _Location.Y = DraggableBandObjects[band_Num].Region.Bottom - 20 - 51;
            }

            Draggable draggableBlock = new Draggable(_Location.X, _Location.Y, control_Type);
            DraggableObjects.Add(draggableBlock);

            int _width  = 51;
            int _height = 51;

            DraggableObjects[control_Num].Belong_Band        = band_Num;
            DraggableObjects[control_Num].Field_Align        = "Left,Top";
            DraggableObjects[control_Num].Field_TextFont     = "微软雅黑";
            DraggableObjects[control_Num].Field_ControlColor = Color.FromArgb(0, 0, 0);
            DraggableObjects[control_Num].Field_TextFontSize = 9;
            DraggableObjects[control_Num].Field_ImgZoom      = 1;

            for (int i = 0; i < 8; i++)
            {
                DraggableObjects[control_Num].Field_BoxLine[i] = false;
            }
            DraggableObjects[control_Num].Setimage = LinBox(_width, _height, 1, control_Type, control_Num);
            control_Type = -1;
            Print_PageType.Invalidate();

            RBuild_Info.set_Info(DraggableObjects[control_Num].ControlType);

            Object_Record();
            ReportChange_Flag = true;
        }
    }
コード例 #10
0
    /// <summary>
    /// 报表编辑
    /// </summary>
    public static void Initialize_Design()
    {
        printDocument = new PrintDocument();
        get_pageType();
        Initialize_PageMode();
        Set_PrintPageType(4, 0);

        // 获取打印机
        DefaultPrinter = printDocument.PrinterSettings.PrinterName;  //默认打印机名
        foreach (string sprint in PrinterSettings.InstalledPrinters) //获取所有打印机名称
        {
            printers.Add(new Printer_List(sprint));
        }

        Use_HotKey  = true;
        design_Form = new RbControls_FormCreate(); // 建立窗体

        RbControls_ConextMenu _ConextMenu = new RbControls_ConextMenu();

        _ConextMenu.Menu(design_Form.panel_Title, RBuild_Menu.total_Menu, RBuild_Menu.menu_text, RBuild_Menu.menu_point, 23, RBuild_Menu.menu_width, system_Font, Color.White, Color.FromArgb(241, 241, 241), Color.Black, RBuild_Menu.ToolMenuMove);
        _ConextMenu.text_label[0].BackColor = Color.FromArgb(241, 241, 241);
        _ConextMenu.text_label[0].ForeColor = Color.Black;

        // 工具栏
        for (int i = 0; i < 4; i++)
        {
            panel_Tool[i] = new PanelEx()
            {
                Dock = DockStyle.Top, Height = 35, Cursor = Cursors.Default, BackColor = Color.FromArgb(238, 238, 242)
            };
            PanelEx panel_Line = new PanelEx()
            {
                Dock = DockStyle.Bottom, Height = 1, BackgroundImage = EzRBuild.EzResource.line, BackgroundImageLayout = ImageLayout.Stretch
            };
            panel_Tool[i].Controls.Add(panel_Line);

            if (i == 0)
            {
                panel_Tool[i].Visible = true;
            }
            else
            {
                panel_Tool[i].Visible = false;
            }

            RBuild_Menu.tool_Control(i, panel_Tool[i]);
            design_Form._formObject.Controls.Add(panel_Tool[i]);
        }

        // 页面设计
        page_Desing = new PanelEx()
        {
            Size     = new Size(design_Form._formObject.Width - 4, design_Form._formObject.Height - 161),
            Cursor   = Cursors.Default,
            Location = new Point(2, 97)
        };
        design_Form._formObject.Controls.Add(page_Desing);

        // 页面容器
        page_Container = new PanelEx()
        {
            Size       = new Size(page_Desing.Width - 20, page_Desing.Height - 20),
            Location   = new Point(20, 20),
            AutoScroll = true,
            Cursor     = Cursors.Default,
            BackColor  = Color.FromArgb(195, 195, 195)
        };
        page_Container.Paint += RBuild_Paint.pageContainer_Paint;
        page_Desing.Controls.Add(page_Container);

        // 页面装入框
        int _iLeft = (page_Container.Width / 2) - (page_TypeFace.Page_Area.Width / 2);

        if (_iLeft < 0)
        {
            _iLeft = 0;
        }
        page_Install = new PanelEx()
        {
            Size      = new Size(page_TypeFace.Page_Area.Width + 20, page_TypeFace.Page_Area.Height + 20),
            Location  = new Point(_iLeft, 0),
            Cursor    = Cursors.Default,
            BackColor = Color.Transparent
        };
        page_Install.Paint += RBuild_Paint.pageInstall_Paint;
        page_Container.Controls.Add(page_Install);
        // 页面
        Print_PageType = new PanelEx()
        {
            Size      = page_TypeFace.Page_Area,
            Location  = new Point(10, 10),
            Cursor    = Cursors.Default,
            BackColor = Color.White
        };
        Print_PageType.Paint      += RBuild_Paint.PrintPageType_Paint;
        Print_PageType.Click      += RBuild_MouseEvent.PageType_Click;
        Print_PageType.MouseClick += RBuild_MouseEvent.PageType_MouseClick;
        Print_PageType.MouseUp    += RBuild_MouseEvent.PageType_MouseUp;
        Print_PageType.MouseDown  += RBuild_MouseEvent.PageType_MouseDown;
        Print_PageType.MouseMove  += RBuild_MouseEvent.PageType_MouseMove;
        page_Install.Controls.Add(Print_PageType);

        // 标尺
        PictureBoxEx pic_VRuler = new PictureBoxEx()
        {
            Dock      = DockStyle.Left,
            Image     = VRuler(1100),
            Width     = 20,
            Cursor    = Cursors.Default,
            BackColor = Color.White
        };

        page_Desing.Controls.Add(pic_VRuler);

        PictureBoxEx pic_HRuler = new PictureBoxEx()
        {
            Dock      = DockStyle.Top,
            Image     = HRuler(2000),
            Height    = 20,
            Cursor    = Cursors.Default,
            BackColor = Color.White
        };

        page_Desing.Controls.Add(pic_HRuler);

        Initialize_Band();
        RBuild_Menu.Initialize_MenuStrip();
        RBuild_Info.Initialize_Info(design_Form._formObject);


        RBuild_Info.Composite_Info = new RbControls_TextLabel();
        RBuild_Info.Composite_Info.Text_Label(
            design_Form.panel_Title, new Point(225, 40), system_Font, Color.FromArgb(230, 230, 230),
            "✐  当前纸张:" + page_types[page_TypeFace.Page_Type] + ", 纵向" + "  ✐  打印机:" + DefaultPrinter + "  ✐  数据库: None  ✐"
            );

        RbControls_DrawTextMethod ds = new RbControls_DrawTextMethod();
        Bitmap report_Icon           = new Bitmap(20, 20);

        ds.DrawFontAwesome(report_Icon, RbControls_FontAwesome.Type.FileText, 20, Color.FromArgb(250, 250, 250), new Point(0, 0), false);
        PictureBoxEx report_pic = new PictureBoxEx()
        {
            Size      = new Size(20, 20),
            Location  = new Point(10, 6),
            Image     = report_Icon,
            BackColor = Color.Transparent
        };

        design_Form.panel_Title.Controls.Add(report_pic);

        ReportFile_Name = new Label()
        {
            AutoSize  = true,
            Location  = new Point(30, 6),
            Font      = system_Font,
            ForeColor = Color.White,
            Text      = "MyReport.rpt",
            BackColor = Color.Transparent
        };
        design_Form.panel_Title.Controls.Add(ReportFile_Name);

        design_Form.Create_Form(page_Container, "design_Form", FormStartPosition.Manual, new Size(1200, 768), new Point(200, 100), system_backColor, form_ShowDialog, false, designForm_Close, formResize); // 显示窗体
    }
コード例 #11
0
    private void acceptSet_Click(object sender, EventArgs e)
    {
        Label pL = (Label)sender;

        if ((int)pL.Tag == 1)
        {
            _pgselect = _record;
            setPage_Form._formObject.Close();
        }
        else
        {
            for (int i = 0; i < 4; i++)
            {
                page_TypeFace.Page_Margin[i] = int.Parse(input_Margin[i].textBox.Text.Trim());
            }
            page_TypeFace.Page_Type = _pgselect;

            if ((_record != _pgselect) || (input_def[0].textBox.Text != page_TypeFace.Rect_mm[0]) || (input_def[1].textBox.Text != page_TypeFace.Rect_mm[1]) || (page_TypeFace.Page_Direction != _pgdirect))
            {
                RBuild_Info.Set_DefaultInfo();
                DraggableObjects.Clear();
                control_Num = -1;

                page_Container.VerticalScroll.Value   = 0;
                page_Container.HorizontalScroll.Value = 0;

                if (_pgselect == -1)
                {
                    page_TypeFace.Page_Area.Width  = (int)Math.Floor(int.Parse(input_def[0].textBox.Text) * 3.779527559055118);
                    page_TypeFace.Page_Area.Height = (int)Math.Floor(int.Parse(input_def[1].textBox.Text) * 3.779527559055118) + 13 + 126;
                    page_TypeFace.Rect_mm[0]       = input_def[0].textBox.Text;
                    page_TypeFace.Rect_mm[1]       = input_def[1].textBox.Text;
                }
                else
                {
                    Set_PrintPageType(_pgselect, _pgdirect);
                    page_TypeFace.Rect_mm[0] = "";
                    page_TypeFace.Rect_mm[1] = "";
                }
                // 设置预览页面大小
                PreViewPage_Area = new Size(page_TypeFace.Page_Area.Width, page_TypeFace.Page_Area.Height - 126);// 去掉-126

                int height = 120;
                int ly     = 0;
                for (int i = 0; i < 3; i++)
                {
                    if (i == 0)
                    {
                        height = 120; ly = 0;
                    }
                    else if (i == 1)
                    {
                        height = 250; ly = 128;
                    }
                    else if (i == 2)
                    {
                        height = 120; ly = page_TypeFace.Page_Area.Height - height;
                    }
                    DraggableBandObjects[i].Region = new Rectangle(0, ly, page_TypeFace.Page_Area.Width, height);
                }

                page_Install.Size = new Size(page_TypeFace.Page_Area.Width + 20, page_TypeFace.Page_Area.Height + 20);
                int _iLeft = (page_Container.Width / 2) - (page_TypeFace.Page_Area.Width / 2);
                if (_iLeft < 0)
                {
                    _iLeft = 0;
                }
                page_Install.Location = new Point(_iLeft, 0);
                page_Install.Invalidate();

                Print_PageType.Size = page_TypeFace.Page_Area;
            }
            RBuild_Info.Set_CompositeLocation();
            setPage_Form._formObject.Close();
        }
        Print_PageType.Invalidate();
    }