Browse Source

综合-form的默认参数

zhuyi 1 year ago
parent
commit
2020d61e85

+ 21 - 0
Demo/Examples/Compdfkit_Tools/Common/BarControl/FormBarControl.xaml.cs

@@ -248,9 +248,12 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             pdfViewer.PDFToolManager.SetCreateWidgetType(C_WIDGET_TYPE.WIDGET_TEXTFIELD);
             TextBoxParam textBoxParam = new TextBoxParam();
+            textBoxParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
+            textBoxParam.WidgetType = C_WIDGET_TYPE.WIDGET_TEXTFIELD;
             textBoxParam.LineWidth = 1;
             textBoxParam.FontName = "Helvetica";
             textBoxParam.LineColor =new byte[] {0,0,0 };
+            textBoxParam.HasLineColor = true;
             textBoxParam.FieldName = "Text"+ GetTime();
             DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
             defaultSettingParam.SetAnnotParam(textBoxParam);
@@ -261,9 +264,12 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             pdfViewer.PDFToolManager.SetCreateWidgetType(C_WIDGET_TYPE.WIDGET_RADIOBUTTON);
             RadioButtonParam radioButtonParam = new RadioButtonParam();
+            radioButtonParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
+            radioButtonParam.WidgetType = C_WIDGET_TYPE.WIDGET_RADIOBUTTON;
             radioButtonParam.CheckStyle = C_CHECK_STYLE.CK_CIRCLE;
             radioButtonParam.BorderStyle = C_BORDER_STYLE.BS_SOLID;
             radioButtonParam.LineColor = new byte[] { 0, 0, 0 };
+            radioButtonParam.HasLineColor = true;
             radioButtonParam.LineWidth = 2;
             radioButtonParam.FieldName = "Radio button" + GetTime();
             DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
@@ -275,9 +281,12 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             pdfViewer.PDFToolManager.SetCreateWidgetType(C_WIDGET_TYPE.WIDGET_CHECKBOX);
             CheckBoxParam checkBoxParam = new CheckBoxParam();
+            checkBoxParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
+            checkBoxParam.WidgetType = C_WIDGET_TYPE.WIDGET_CHECKBOX;
             checkBoxParam.CheckStyle = C_CHECK_STYLE.CK_CHECK;
             checkBoxParam.BorderStyle = C_BORDER_STYLE.BS_SOLID;
             checkBoxParam.LineColor = new byte[] { 0, 0, 0 };
+            checkBoxParam.HasLineColor = true;
             checkBoxParam.LineWidth = 1;
             checkBoxParam.FieldName = "Checkbox" + GetTime();
             DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
@@ -289,7 +298,10 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             pdfViewer.PDFToolManager.SetCreateWidgetType(C_WIDGET_TYPE.WIDGET_COMBOBOX);
             ComboBoxParam comboBoxParam = new ComboBoxParam();
+            comboBoxParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
+            comboBoxParam.WidgetType = C_WIDGET_TYPE.WIDGET_COMBOBOX;
             comboBoxParam.LineColor = new byte[] { 0, 0, 0 };
+            comboBoxParam.HasLineColor = true;
             comboBoxParam.LineWidth = 1;
             comboBoxParam.FieldName = "Combobox" + GetTime();
             DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
@@ -301,7 +313,10 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             pdfViewer.PDFToolManager.SetCreateWidgetType(C_WIDGET_TYPE.WIDGET_LISTBOX);
             ListBoxParam listBoxParam = new ListBoxParam();
+            listBoxParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
+            listBoxParam.WidgetType = C_WIDGET_TYPE.WIDGET_LISTBOX;
             listBoxParam.LineColor = new byte[] { 0, 0, 0 };
+            listBoxParam.HasLineColor = true;
             listBoxParam.LineWidth = 1;
             listBoxParam.FieldName = "List" + GetTime();
             DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
@@ -313,8 +328,11 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             pdfViewer.PDFToolManager.SetCreateWidgetType(C_WIDGET_TYPE.WIDGET_PUSHBUTTON);
             PushButtonParam pushButtonParam = new PushButtonParam();
+            pushButtonParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
+            pushButtonParam.WidgetType = C_WIDGET_TYPE.WIDGET_PUSHBUTTON;
             pushButtonParam.Text = "Push Button";
             pushButtonParam.LineWidth = 1;
+            pushButtonParam.HasLineColor = true;
             pushButtonParam.Action = C_ACTION_TYPE.ACTION_TYPE_URI;
             pushButtonParam.Uri = @"https://www.compdf.com";
             pushButtonParam.LineColor = new byte[] { 0, 0, 0 };
@@ -328,7 +346,10 @@ namespace Compdfkit_Tools.PDFControl
             pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             pdfViewer.PDFToolManager.SetCreateWidgetType(C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS);
             SignatureParam signatureParam = new SignatureParam();
+            signatureParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_WIDGET;
+            signatureParam.WidgetType = C_WIDGET_TYPE.WIDGET_SIGNATUREFIELDS;
             signatureParam.LineWidth = 1;
+            signatureParam.HasLineColor = true;
             signatureParam.LineColor = new byte[] { 0, 0, 0 };
             signatureParam.FieldName= "Signature" + GetTime();
             DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();