public void Search()
    {
        new RbControls_SpearLine().Spear_line(search_Form.form_panel, new Size(25, 25), new Point(5, 5), EzRBuild.EzResource.search);
        new RbControls_TextLabel().Text_Label(search_Form.form_panel, new Point(30, 7), system_Font, system_FontColor, "查找文字");
        search_input.input_Box(search_Form.form_panel, 190, new Point(10, 32), system_Font, Color.Salmon, Color.White, "", 1024, false, input_Normal, null, null);

        new RbControls_ButtonLabel().Button_Label(search_Form.form_panel, new Point(205, 32), Color.Salmon, Color.Salmon, Color.Salmon, "[×]", system_Font, 0, SearchClear_Click);
        new RbControls_ButtonLabel().Button_Label(search_Form.form_panel, new Point(228, 32), Color.Salmon, Color.Salmon, Color.Salmon, "[◢ 确定]", system_Font, 1, SearchAccept_Click);

        new RbControls_TextLabel().Text_Label(search_Form.form_panel, new Point(10, 57), system_Font, Color.Black, "查询结果:");

        search_Result.Text_Label(search_Form.form_panel, new Point(75, 57), system_Font, Color.Salmon, "");

        search_Form.Create_Dialog(
            "search_Form", FormStartPosition.Manual, new Size(285, 80), new Point(RBuild_Preview.preview_Form.LocationEX.X + 10, RBuild_Preview.preview_Form.LocationEX.Y + 130),
            Color.White, form_Show, true, null);
    }
Пример #2
0
    public void panel_Preview(Control obj)
    {
        page_View = new PanelEx()
        {
            Size      = new Size(obj.Width - 4, obj.Height - 125),
            Location  = new Point(2, 97),
            Cursor    = Cursors.Default,
            BackColor = Color.FromArgb(150, 150, 150)
        };
        obj.Controls.Add(page_View);

        page_Container = new PanelEx()
        {
            Dock       = DockStyle.Fill,
            AutoScroll = true,
            BackColor  = Color.FromArgb(150, 150, 150)
        };
        page_View.Controls.Add(page_Container);

        page_Install = new PanelEx()
        {
            Size      = new Size(page_Container.Width - 20, page_Container.Height),
            Location  = new Point(0, 0),
            BackColor = Color.Transparent
        };
        page_Install.MouseDown       += PageInstall_MouseDown;
        page_Install.LocationChanged += PageInstall_LocationChanged;
        page_Container.Controls.Add(page_Install);

        // 装入预览页面图像
        Report_generation(page_TypeFace.Page_Direction);
        if (report_Pages.Count > 0)
        {
            int pwidth  = PreViewPage_Area.Width;
            int pheight = PreViewPage_Area.Height;

            int px = (page_Install.Width - pwidth + 20) / 2;
            if (px < 0)
            {
                px = 0;
            }

            panel_Outer = new PanelEx[report_Pages.Count];
            panel_Page  = new PanelEx[report_Pages.Count];

            for (int i = 0; i < report_Pages.Count; i++)
            {
                panel_Outer[i] = new PanelEx()
                {
                    Size      = new Size(pwidth + 20, pheight + 20),
                    Location  = new Point(px, i * (pheight + 20)),
                    BackColor = Color.FromArgb(150, 150, 150),
                };
                panel_Outer[i].MouseDown += PageInstall_MouseDown;

                panel_Page[i] = new PanelEx()
                {
                    Size            = new Size(pwidth, pheight),
                    Location        = new Point(10, 10),
                    BackColor       = Color.FromArgb(250, 250, 250),
                    BackgroundImage = report_Pages[i].pageImage
                };
                panel_Page[i].MouseDown += PageInstall_MouseDown;
                panel_Outer[i].Controls.Add(panel_Page[i]);
                page_Install.Controls.Add(panel_Outer[i]);
                page_Install.AutoSize = true;
            }
        }

        // 缩放菜单
        Preview_Menu = new ContextMenuStrip()
        {
            ShowImageMargin = false, Font = system_Font
        };
        for (int i = 0; i < 10; i++)
        {
            pm_Item[i] = new ToolStripMenuItem()
            {
                AutoSize = true,
                Text     = pm_text[i],
                Tag      = i
            };
            pm_Item[i].Click += PreView_Click;
            Preview_Menu.Items.Add(pm_Item[i]);
        }
        pm_Item[2].Text = "●  " + pm_text[2].Trim();

        // 底部信息栏
        panel_Info = new PanelEx()
        {
            Size      = new Size(obj.Width - 4, 25),
            Location  = new Point(2, obj.Height - 27),
            BackColor = Color.Transparent,
        };
        obj.Controls.Add(panel_Info);
        PanelEx panel_LineInfo = new PanelEx()
        {
            Dock                  = DockStyle.Top,
            Height                = 1,
            BackgroundImage       = EzRBuild.EzResource.line,
            BackgroundImageLayout = ImageLayout.Stretch
        };

        panel_Info.Controls.Add(panel_LineInfo);

        // 预览信息
        PictureBoxEx info_Icon = new PictureBoxEx()
        {
            Size      = new Size(20, 20),
            Location  = new Point(5, 2),
            Image     = EzRBuild.EzResource.prview,
            BackColor = Color.Transparent
        };

        panel_Info.Controls.Add(info_Icon);

        pg_Total = new RbControls_TextLabel();
        pg_Total.Text_Label(panel_Info, new Point(75, 5), system_Font, system_previewFontColor, Total_Page + " .");

        pg_Now = new RbControls_TextLabel();
        pg_Now.Text_Label(panel_Info, new Point(165, 5), system_Font, system_previewFontColor, Now_Page + " .");

        string _direct = page_TypeFace.Page_Type + "";

        if (page_TypeFace.Page_Type != -1)
        {
            _direct = page_types[page_TypeFace.Page_Type] + ", " + page_size[page_TypeFace.Page_Type] + " 毫米";
            if (page_TypeFace.Page_Direction == 0)
            {
                _direct += ",纵向,";
            }
            else
            {
                _direct += ",横向,";
            }
        }
        else
        {
            _direct = "自定义纸张";
        }

        new RbControls_TextLabel().Text_Label(panel_Info, new Point(280, 5), system_Font, system_previewFontColor, _direct);

        page_Info = new RbControls_TextLabel();
        page_Info.Text_Label(panel_Info, new Point(30, 5), system_Font, system_FontColor, "总页数:          当前页:                    纸张:");
    }
Пример #3
0
    private static ContextMenuStrip FontSize_Menu; // 字体大小菜单

    public static void Initialize_Info(Control obj)
    {
        PanelEx panel_TopLine = new PanelEx() // 间隔线
        {
            Dock                  = DockStyle.Top,
            Height                = 1,
            BackgroundImage       = EzRBuild.EzResource.line,
            BackgroundImageLayout = ImageLayout.Stretch
        };

        panel_State = new PanelEx() // 底部显示组件信息框
        {
            Size      = new Size(obj.Width - 4, 62),
            Location  = new Point(2, obj.Height - 64),
            Cursor    = Cursors.Default,
            BackColor = system_backColor
        };
        obj.Controls.Add(panel_State);

        pic_ControlType = new RbControls_SpearLine();
        pic_ControlType.Spear_line(panel_State, new Size(25, 25), new Point(2, 5), EzRBuild.EzResource.mouse);

        panel_State.Controls.Add(panel_TopLine);

        Label_ControlType = new RbControls_TextLabel();
        Label_ControlType.Text_Label(panel_State, new Point(27, 6), system_Font, system_FontColor, "");
        Label_ControlSize = new RbControls_TextLabel();
        Label_ControlSize.Text_Label(panel_State, new Point(7, 28), system_Font, system_FontColor, "范围:");
        Label_ControlPoint = new RbControls_TextLabel();
        Label_ControlPoint.Text_Label(panel_State, new Point(7, 44), system_Font, system_FontColor, "位置:");

        new RbControls_SpearLine().Spear_line(panel_State, new Size(5, 50), new Point(160, 8), EzRBuild.EzResource.spearInfo);

        panel_State.Controls.Add(panel_TopLine);

        // 获取字体
        InstalledFontCollection Fonts = new InstalledFontCollection();

        FontFamilies = Fonts.Families;
        Font_Menu    = new ContextMenuStrip()
        {
            ShowImageMargin = false, Font = system_Font
        };
        ToolStripMenuItem[] menu_Item = new ToolStripMenuItem[FontFamilies.Length];
        for (int i = FontFamilies.Length - 1; i > 0; i--)
        {
            menu_Item[i] = new ToolStripMenuItem()
            {
                AutoSize = true,
                Font     = system_Font,
                Text     = FontFamilies[i].Name,
            };
            menu_Item[i].Click += fontMenu_Click;
            Font_Menu.Items.Add(menu_Item[i]);
        }

        // 字体大小
        string[] size_value = new string[19] {
            "5", "6", "7", "8", "9", "10", "11", "12", "14", "16", "18", "20", "22", "24", "26", "28", "36", "48", "72"
        };
        FontSize_Menu = new ContextMenuStrip()
        {
            ShowImageMargin = false, Font = system_Font
        };
        ToolStripMenuItem[] menu_ItemSize = new ToolStripMenuItem[19];
        for (int i = 0; i < 19; i++)
        {
            menu_ItemSize[i] = new ToolStripMenuItem()
            {
                AutoSize = true,
                Font     = system_Font,
                Text     = size_value[i],
            };
            menu_ItemSize[i].Click += sizeMenu_Click;
            FontSize_Menu.Items.Add(menu_ItemSize[i]);
        }


        for (int i = 0; i < 6; i++)
        {
            panel_setControl[i] = new PanelEx() // 设置框
            {
                Size      = new Size(1018, 50),
                Location  = new Point(175, 8),
                Visible   = false,
                BackColor = system_backColor
            };

            RbControls_TextLabel[] acceptLabels = new RbControls_TextLabel[2];
            string[] acceptMenu = new string[2] {
                "[✔ 应用设置 ]", "[✘ 删除组件 ]"
            };

            int[] _px = new int[2] {
                180, 635
            };
            for (int t = 0; t < 2; t++)
            {
                if (t == 0)
                {
                    new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(1 + t * 85, 4), system_buttonColor, Color.Salmon, system_buttonColor, acceptMenu[t], system_Font, t, accept_Attributes);
                }
                else
                {
                    new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(1 + t * 85, 4), system_buttonColor, Color.Salmon, system_buttonColor, acceptMenu[t], system_Font, t, null);
                }
                new RbControls_SpearLine().Spear_line(panel_setControl[i], new Size(5, 25), new Point(_px[t], 0), EzRBuild.EzResource.spear);
            }

            // 属性输入框
            int[] _inputX = new int[4] {
                230, 335, 450, 565
            };
            for (int t = 0; t < 4; t++)
            {
                attribute_Input[i, t] = new RbControls_TextBox();
                attribute_Input[i, t].input_Box(panel_setControl[i], 60, new Point(_inputX[t], 4), system_Font, Color.Salmon, system_backColor, "", 4, false, input_Number, null, null);
            }
            string label_txt = "宽度:                 高度:                 位置(x):                位置(y):                    颜色:";
            // 设置颜色
            if (i != 1)
            {
                new RbControls_PanelLine().Panel_Line(panel_setControl[i], new Size(30, 1), new Point(685, 20));
                Content_Color[i] = new RbControls_ColorPad();
                Content_Color[i].colorPad(panel_setControl[i], new Point(755, 7), new Size(11, 11), 15, Color.Transparent, colorSelect_Click);
                color_Flag[i] = new RbControls_TextLabel();
                color_Flag[i].Text_Label(panel_setControl[i], new Point(690, 3), system_Font, Color.Black, "█▌");
            }
            else
            {
                label_txt = "宽度:                 高度:                 位置(x):                位置(y):";
            }
            new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(195, 4), system_Font, system_FontColor, label_txt);

            // 对齐方式
            if (i != 2)
            {
                string[] align_label    = new string[] { "左", "右", "顶", "底", "居中", "垂直" };
                int[]    align_location = new int[] { 48, 83, 118, 153, 188, 233 };
                for (int t = 0; t < 6; t++)
                {
                    align_Check[i, t] = new RbControls_CheckBox();
                    if ((t == 0) || (t == 2))
                    {
                        align_Check[i, t].check_Box(panel_setControl[i], true, t, new Point(align_location[t], 30), system_FontColor, system_Font, align_label[t], check_AlwaysTrue, align_Click);
                    }
                    else
                    {
                        align_Check[i, t].check_Box(panel_setControl[i], false, t, new Point(align_location[t], 30), system_FontColor, system_Font, align_label[t], check_AlwaysTrue, align_Click);
                    }
                }
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(1, 31), system_Font, system_FontColor, "[ 对齐:");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(281, 31), system_Font, system_FontColor, "]");
            }

            // 设置字体
            if ((i != 1) && (i != 2))
            {
                font_type[i] = new RbControls_TextLabel();
                font_type[i].Text_Label(panel_setControl[i], new Point(340, 31), system_Font, Color.Salmon, "微软雅黑");
                new RbControls_PanelLine().Panel_Line(panel_setControl[i], new Size(128, 1), new Point(345, 48));

                font_size[i] = new RbControls_TextLabel();
                font_size[i].Text_Label(panel_setControl[i], new Point(545, 31), system_Font, Color.Salmon, "9");
                new RbControls_PanelLine().Panel_Line(panel_setControl[i], new Size(37, 1), new Point(540, 48));

                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(300, 31), system_Font, system_FontColor, "[ 字体:");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(487, 31), system_Font, system_FontColor, "] [ 字号:");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(590, 31), system_Font, system_FontColor, "]");
                new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(475, 31), Color.Salmon, Color.Salmon, Color.Salmon, "◥", system_Font, 0, fontLabe_MouseDown);
                new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(575, 31), Color.Salmon, Color.Salmon, Color.Salmon, "◥", system_Font, 0, sizeLabe_MouseDown);

                string[] render_menu     = new string[] { "加粗", "倾斜", "下划线" };
                int[]    render_location = new int[] { 625, 675, 725 };
                for (int t = 0; t < 3; t++)
                {
                    font_render[i, t] = new RbControls_CheckBox();
                    font_render[i, t].check_Box(panel_setControl[i], false, t, new Point(render_location[t], 30), system_FontColor, system_Font, render_menu[t], check_Normal, null);
                }
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(610, 31), system_Font, system_FontColor, "[");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(785, 31), system_Font, system_FontColor, "]");
            }
            panel_State.Controls.Add(panel_setControl[i]);

            if (i == 0) // 文本框
            {
                content_TextInput = new RbControls_TextBox();
                content_TextInput.input_Box(panel_setControl[i], 168, new Point(830, 31), system_Font, Color.Salmon, system_backColor, "", 4096, false, input_Normal, null, null);
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(795, 31), system_Font, system_FontColor, "内容:");
                new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(1000, 33), Color.Salmon, Color.Salmon, Color.Salmon, "×", system_Font, 0, TextClear_Click);
            }

            if (i == 1) // 图像
            {
                content_ImgInput = new RbControls_TextBox();
                content_ImgInput.input_Box(panel_setControl[i], 150, new Point(520, 31), system_Font, Color.Salmon, system_backColor, "", 4096, false, 0, null, null);
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(450, 31), system_Font, system_FontColor, "图像文件:");

                string[] Img_Zoom = new string[2] {
                    "原始大小", "缩放"
                };
                for (int t = 0; t < 2; t++)
                {
                    ImgZoom_CheckBox[t] = new RbControls_CheckBox();
                    if (t == 0)
                    {
                        ImgZoom_CheckBox[t].check_Box(panel_setControl[i], false, t, new Point(315 + t * 75, 30), system_FontColor, system_Font, Img_Zoom[t], check_AlwaysTrue, ImgZoom_Click);
                    }
                    else
                    {
                        ImgZoom_CheckBox[t].check_Box(panel_setControl[i], true, t, new Point(315 + t * 75, 30), system_FontColor, system_Font, Img_Zoom[t], check_AlwaysTrue, ImgZoom_Click);
                    }
                }
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(300, 31), system_Font, system_FontColor, "[");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(435, 31), system_Font, system_FontColor, "]");

                string[] ImgZoom_text = new string[2] {
                    "◥", "×"
                };
                RbControls_ButtonLabel[] ImgZoom_Button = new RbControls_ButtonLabel[2];
                for (int t = 0; t < 2; t++)
                {
                    ImgZoom_Button[t] = new RbControls_ButtonLabel();
                    if (t == 0)
                    {
                        ImgZoom_Button[t].Button_Label(panel_setControl[i], new Point(673 + t * 18, 33), Color.Salmon, Color.Salmon, Color.Salmon, ImgZoom_text[t], system_Font, t, openImg_Click);
                    }
                    else
                    {
                        ImgZoom_Button[t].Button_Label(panel_setControl[i], new Point(673 + t * 18, 33), Color.Salmon, Color.Salmon, Color.Salmon, ImgZoom_text[t], system_Font, t, openClear_Click);
                    }
                }
            }

            if (i == 2) // 形状
            {
                Bitmap[] shaps_bmp = new Bitmap[20];
                for (int t = 0; t < 20; t++)
                {
                    shap_select[t] = new RbControls_CheckBox();
                    shap_select[t].check_Box(panel_setControl[i], false, t, new Point(48 + t * 40, 30), system_backColor, system_Font, null, check_AlwaysTrue, ShapSelect_Click);

                    shaps_bmp[t] = new Bitmap(20, 20);
                    ds.DrawFontAwesome(shaps_bmp[t], shaps_type[t], 20, Color.FromArgb(150, 150, 150), new Point(0, 0), false);

                    shaps_pic[t] = new Label()
                    {
                        Size      = new Size(20, 20),
                        Location  = new Point(65 + t * 40, 31),
                        Image     = shaps_bmp[t],
                        Cursor    = Cursors.Hand,
                        BackColor = Color.Transparent,
                        Tag       = t
                    };

                    shaps_pic[t].Click += ShapSelect_Click;
                    panel_setControl[i].Controls.Add(shaps_pic[t]);
                }
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(1, 31), system_Font, system_FontColor, "[ 样式:");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(845, 31), system_Font, system_FontColor, "]");
            }

            if (i == 3) // 数据库字段
            {
                content_DataInput = new RbControls_TextBox();
                content_DataInput.input_Box(panel_setControl[i], 150, new Point(840, 31), system_Font, Color.Salmon, system_backColor, "", 4096, true, input_Normal, null, null);
                new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(990, 33), Color.Salmon, Color.Salmon, Color.Salmon, "◥", system_Font, 0, FieldSelect_MouseDown);
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(795, 31), system_Font, system_FontColor, "[ 字段:");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(1005, 31), system_Font, system_FontColor, "]");

                DataField_Menu = new ContextMenuStrip()
                {
                    ShowImageMargin = false, Font = system_Font
                };
            }

            if (i == 4) // 页码
            {
                content_PcodeInput = new RbControls_TextBox();
                content_PcodeInput.input_Box(panel_setControl[i], 150, new Point(840, 31), system_Font, Color.Salmon, system_backColor, "", 64, true, input_Normal, null, null);
                new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(990, 33), Color.Salmon, Color.Salmon, Color.Salmon, "◥", system_Font, 0, pgCode_Click);
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(795, 31), system_Font, system_FontColor, "[ 样式:");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(1005, 31), system_Font, system_FontColor, "]");

                string[] pgCode_MenuText = new string[8] {
                    "[1] , [2] , [3] , ...", "(1) , (2) , (3) , ...", "-1- , -2- , -3- , ...", "1 , 2 , 3 , ...", "-1 , -2 , -3 , ...", "1-99 , 2-99 , ...", "Page 1 of 99 , ...", "第1页 , 第2页 ..."
                };
                pgCode_Menu = new ContextMenuStrip()
                {
                    ShowImageMargin = false, Font = system_Font
                };
                ToolStripMenuItem[] menu_ItemCode = new ToolStripMenuItem[8];
                for (int t = 0; t < 8; t++)
                {
                    menu_ItemCode[t] = new ToolStripMenuItem()
                    {
                        AutoSize = true,
                        Font     = system_Font,
                        Text     = pgCode_MenuText[t],
                        Tag      = t
                    };
                    menu_ItemCode[t].Click += pgMenuCode_Click;
                    pgCode_Menu.Items.Add(menu_ItemCode[t]);
                }
            }

            if (i == 5) // 数据库运算
            {
                content_FunctionInput = new RbControls_TextBox();
                content_FunctionInput.input_Box(panel_setControl[i], 150, new Point(840, 31), system_Font, Color.Salmon, system_backColor, "", 4096, true, input_Normal, null, null);
                new RbControls_ButtonLabel().Button_Label(panel_setControl[i], new Point(990, 33), Color.Salmon, Color.Salmon, Color.Salmon, "◥", system_Font, 0, FieldFunction_MouseDown);
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(795, 31), system_Font, system_FontColor, "[ 运算:");
                new RbControls_TextLabel().Text_Label(panel_setControl[i], new Point(1005, 31), system_Font, system_FontColor, "]");

                DataField_Menu = new ContextMenuStrip()
                {
                    ShowImageMargin = false, Font = system_Font
                };
            }
        }

        Task View_ControlInfo = new Task(Set_ControlMoveInfo);

        View_ControlInfo.Start();
    }