diff --git a/WordAddIn/.vs/WordAddIn/FileContentIndex/0595dd45-9906-4cc6-b483-b639167a1d9a.vsidx b/WordAddIn/.vs/WordAddIn/FileContentIndex/0595dd45-9906-4cc6-b483-b639167a1d9a.vsidx deleted file mode 100644 index 456afe9..0000000 Binary files a/WordAddIn/.vs/WordAddIn/FileContentIndex/0595dd45-9906-4cc6-b483-b639167a1d9a.vsidx and /dev/null differ diff --git a/WordAddIn/.vs/WordAddIn/v17/.suo b/WordAddIn/.vs/WordAddIn/v17/.suo index 37fedb4..c243eff 100644 Binary files a/WordAddIn/.vs/WordAddIn/v17/.suo and b/WordAddIn/.vs/WordAddIn/v17/.suo differ diff --git a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json index 3d9457a..131493c 100644 --- a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json +++ b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.backup.json @@ -1,24 +1,7 @@ { "Version": 1, "WorkspaceRootPath": "D:\\dsWork\\aiData\\WordAddIn\\", - "Documents": [ - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|d:\\dswork\\aidata\\wordaddin\\wordaddin\\airibbon.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\airibbon.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|D:\\dsWork\\aiData\\WordAddIn\\wordaddin\\airibbon.xml||{FA3CD31E-987B-443A-9B81-186104E8DAC1}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\airibbon.xml||{FA3CD31E-987B-443A-9B81-186104E8DAC1}" - }, - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|D:\\dsWork\\aiData\\WordAddIn\\wordaddin\\loadingform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\loadingform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|D:\\dsWork\\aiData\\WordAddIn\\wordaddin\\loginform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\loginform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - } - ], + "Documents": [], "DocumentGroupContainers": [ { "Orientation": 0, @@ -26,60 +9,11 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 0, + "SelectedChildIndex": -1, "Children": [ - { - "$type": "Document", - "DocumentIndex": 0, - "Title": "AiRibbon.cs", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.cs", - "RelativeDocumentMoniker": "WordAddIn\\AiRibbon.cs", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.cs", - "RelativeToolTip": "WordAddIn\\AiRibbon.cs", - "ViewState": "AgIAACgAAAAAAAAAAAAAACgAAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-01-24T02:46:43.959Z", - "EditorCaption": "" - }, { "$type": "Bookmark", "Name": "ST:0:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}" - }, - { - "$type": "Document", - "DocumentIndex": 1, - "Title": "AiRibbon.xml", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.xml", - "RelativeDocumentMoniker": "WordAddIn\\AiRibbon.xml", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.xml", - "RelativeToolTip": "WordAddIn\\AiRibbon.xml", - "ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003576|", - "WhenOpened": "2026-01-24T02:29:50.049Z" - }, - { - "$type": "Document", - "DocumentIndex": 2, - "Title": "LoadingForm.cs", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoadingForm.cs", - "RelativeDocumentMoniker": "WordAddIn\\LoadingForm.cs", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoadingForm.cs", - "RelativeToolTip": "WordAddIn\\LoadingForm.cs", - "ViewState": "AgIAAAAAAAAAAAAAAAAAABsAAAAZAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-01-24T02:08:22.195Z" - }, - { - "$type": "Document", - "DocumentIndex": 3, - "Title": "LoginForm.cs", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoginForm.cs", - "RelativeDocumentMoniker": "WordAddIn\\LoginForm.cs", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoginForm.cs", - "RelativeToolTip": "WordAddIn\\LoginForm.cs", - "ViewState": "AgIAABsAAAAAAAAAAIAwwCYAAAAYAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-01-24T02:08:17.782Z" } ] } diff --git a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json index 3d9457a..131493c 100644 --- a/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json +++ b/WordAddIn/.vs/WordAddIn/v17/DocumentLayout.json @@ -1,24 +1,7 @@ { "Version": 1, "WorkspaceRootPath": "D:\\dsWork\\aiData\\WordAddIn\\", - "Documents": [ - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|d:\\dswork\\aidata\\wordaddin\\wordaddin\\airibbon.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\airibbon.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|D:\\dsWork\\aiData\\WordAddIn\\wordaddin\\airibbon.xml||{FA3CD31E-987B-443A-9B81-186104E8DAC1}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\airibbon.xml||{FA3CD31E-987B-443A-9B81-186104E8DAC1}" - }, - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|D:\\dsWork\\aiData\\WordAddIn\\wordaddin\\loadingform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\loadingform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|D:\\dsWork\\aiData\\WordAddIn\\wordaddin\\loginform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{EC0A80FA-FCBD-4239-945A-627B20CCCBAA}|WordAddIn\\WordAddIn.csproj|solutionrelative:wordaddin\\loginform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - } - ], + "Documents": [], "DocumentGroupContainers": [ { "Orientation": 0, @@ -26,60 +9,11 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 0, + "SelectedChildIndex": -1, "Children": [ - { - "$type": "Document", - "DocumentIndex": 0, - "Title": "AiRibbon.cs", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.cs", - "RelativeDocumentMoniker": "WordAddIn\\AiRibbon.cs", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.cs", - "RelativeToolTip": "WordAddIn\\AiRibbon.cs", - "ViewState": "AgIAACgAAAAAAAAAAAAAACgAAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-01-24T02:46:43.959Z", - "EditorCaption": "" - }, { "$type": "Bookmark", "Name": "ST:0:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}" - }, - { - "$type": "Document", - "DocumentIndex": 1, - "Title": "AiRibbon.xml", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.xml", - "RelativeDocumentMoniker": "WordAddIn\\AiRibbon.xml", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\AiRibbon.xml", - "RelativeToolTip": "WordAddIn\\AiRibbon.xml", - "ViewState": "AgIAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003576|", - "WhenOpened": "2026-01-24T02:29:50.049Z" - }, - { - "$type": "Document", - "DocumentIndex": 2, - "Title": "LoadingForm.cs", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoadingForm.cs", - "RelativeDocumentMoniker": "WordAddIn\\LoadingForm.cs", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoadingForm.cs", - "RelativeToolTip": "WordAddIn\\LoadingForm.cs", - "ViewState": "AgIAAAAAAAAAAAAAAAAAABsAAAAZAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-01-24T02:08:22.195Z" - }, - { - "$type": "Document", - "DocumentIndex": 3, - "Title": "LoginForm.cs", - "DocumentMoniker": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoginForm.cs", - "RelativeDocumentMoniker": "WordAddIn\\LoginForm.cs", - "ToolTip": "D:\\dsWork\\aiData\\WordAddIn\\WordAddIn\\LoginForm.cs", - "RelativeToolTip": "WordAddIn\\LoginForm.cs", - "ViewState": "AgIAABsAAAAAAAAAAIAwwCYAAAAYAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-01-24T02:08:17.782Z" } ] } diff --git a/WordAddIn/WordAddIn/ExpandOptionsForm.cs b/WordAddIn/WordAddIn/ExpandOptionsForm.cs index a41a0ed..d149a13 100644 --- a/WordAddIn/WordAddIn/ExpandOptionsForm.cs +++ b/WordAddIn/WordAddIn/ExpandOptionsForm.cs @@ -13,6 +13,8 @@ namespace WordAddIn private TextBox txtCustomPrompt; private Button btnOk; private Button btnCancel; + private Label lblTemplate; + private Label lblCustom; private readonly Dictionary _templates = new Dictionary { @@ -32,40 +34,94 @@ namespace WordAddIn private void InitializeComponent() { - this.Text = "智能扩写设置"; - this.Size = new Size(500, 350); - this.StartPosition = FormStartPosition.CenterScreen; - this.FormBorderStyle = FormBorderStyle.FixedDialog; + this.lblTemplate = new System.Windows.Forms.Label(); + this.lblCustom = new System.Windows.Forms.Label(); + this.cmbTemplates = new System.Windows.Forms.ComboBox(); + this.txtCustomPrompt = new System.Windows.Forms.TextBox(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lblTemplate + // + this.lblTemplate.AutoSize = true; + this.lblTemplate.Location = new System.Drawing.Point(20, 20); + this.lblTemplate.Name = "lblTemplate"; + this.lblTemplate.Size = new System.Drawing.Size(83, 12); + this.lblTemplate.TabIndex = 0; + this.lblTemplate.Text = "选择预设模板:"; + // + // lblCustom + // + this.lblCustom.AutoSize = true; + this.lblCustom.Location = new System.Drawing.Point(20, 80); + this.lblCustom.Name = "lblCustom"; + this.lblCustom.Size = new System.Drawing.Size(107, 12); + this.lblCustom.TabIndex = 2; + this.lblCustom.Text = "扩写要求 (可修改):"; + // + // cmbTemplates + // + this.cmbTemplates.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbTemplates.FormattingEnabled = true; + this.cmbTemplates.Location = new System.Drawing.Point(20, 45); + this.cmbTemplates.Name = "cmbTemplates"; + this.cmbTemplates.Size = new System.Drawing.Size(440, 20); + this.cmbTemplates.TabIndex = 1; + this.cmbTemplates.SelectedIndexChanged += new System.EventHandler(this.CmbTemplates_SelectedIndexChanged); + // + // txtCustomPrompt + // + this.txtCustomPrompt.Location = new System.Drawing.Point(20, 105); + this.txtCustomPrompt.Multiline = true; + this.txtCustomPrompt.Name = "txtCustomPrompt"; + this.txtCustomPrompt.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtCustomPrompt.Size = new System.Drawing.Size(440, 120); + this.txtCustomPrompt.TabIndex = 3; + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(260, 250); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(90, 35); + this.btnOk.TabIndex = 4; + this.btnOk.Text = "开始扩写"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.BtnOk_Click); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(370, 250); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(90, 35); + this.btnCancel.TabIndex = 5; + this.btnCancel.Text = "取消"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // ExpandOptionsForm + // + this.AcceptButton = this.btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(500, 311); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.txtCustomPrompt); + this.Controls.Add(this.lblCustom); + this.Controls.Add(this.cmbTemplates); + this.Controls.Add(this.lblTemplate); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; + this.Name = "ExpandOptionsForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "智能扩写设置"; + this.ResumeLayout(false); + this.PerformLayout(); - // Labels - var lblTemplate = new Label { Text = "选择预设模板:", Location = new Point(20, 20), AutoSize = true }; - var lblCustom = new Label { Text = "扩写要求 (可修改):", Location = new Point(20, 80), AutoSize = true }; - - // ComboBox - cmbTemplates = new ComboBox { Location = new Point(20, 45), Width = 440, DropDownStyle = ComboBoxStyle.DropDownList }; - cmbTemplates.SelectedIndexChanged += CmbTemplates_SelectedIndexChanged; - - // TextBox - txtCustomPrompt = new TextBox { Location = new Point(20, 105), Width = 440, Height = 120, Multiline = true, ScrollBars = ScrollBars.Vertical }; - - // Buttons - btnOk = new Button { Text = "开始扩写", Location = new Point(260, 250), Width = 90, Height = 35, DialogResult = DialogResult.OK }; - btnOk.Click += BtnOk_Click; - - btnCancel = new Button { Text = "取消", Location = new Point(370, 250), Width = 90, Height = 35, DialogResult = DialogResult.Cancel }; - - // Add Controls - this.Controls.Add(lblTemplate); - this.Controls.Add(cmbTemplates); - this.Controls.Add(lblCustom); - this.Controls.Add(txtCustomPrompt); - this.Controls.Add(btnOk); - this.Controls.Add(btnCancel); - - this.AcceptButton = btnOk; - this.CancelButton = btnCancel; } private void InitializeTemplates() diff --git a/WordAddIn/WordAddIn/ImageOptionsForm.cs b/WordAddIn/WordAddIn/ImageOptionsForm.cs index 6a4385b..6d299a2 100644 --- a/WordAddIn/WordAddIn/ImageOptionsForm.cs +++ b/WordAddIn/WordAddIn/ImageOptionsForm.cs @@ -15,6 +15,8 @@ namespace WordAddIn private TextBox txtAdditionalPrompt; private Button btnOk; private Button btnCancel; + private Label lblStyle; + private Label lblPrompt; private readonly string[] _styles = new string[] { @@ -36,43 +38,93 @@ namespace WordAddIn private void InitializeComponent() { - this.Text = "生成配图设置"; - this.Size = new Size(450, 300); - this.StartPosition = FormStartPosition.CenterScreen; - this.FormBorderStyle = FormBorderStyle.FixedDialog; + this.lblStyle = new System.Windows.Forms.Label(); + this.cmbStyles = new System.Windows.Forms.ComboBox(); + this.lblPrompt = new System.Windows.Forms.Label(); + this.txtAdditionalPrompt = new System.Windows.Forms.TextBox(); + this.btnOk = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lblStyle + // + this.lblStyle.AutoSize = true; + this.lblStyle.Location = new System.Drawing.Point(30, 30); + this.lblStyle.Name = "lblStyle"; + this.lblStyle.Size = new System.Drawing.Size(59, 12); + this.lblStyle.TabIndex = 0; + this.lblStyle.Text = "图片风格:"; + // + // cmbStyles + // + this.cmbStyles.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cmbStyles.FormattingEnabled = true; + this.cmbStyles.Location = new System.Drawing.Point(30, 55); + this.cmbStyles.Name = "cmbStyles"; + this.cmbStyles.Size = new System.Drawing.Size(370, 20); + this.cmbStyles.TabIndex = 1; + // + // lblPrompt + // + this.lblPrompt.AutoSize = true; + this.lblPrompt.Location = new System.Drawing.Point(30, 100); + this.lblPrompt.Name = "lblPrompt"; + this.lblPrompt.Size = new System.Drawing.Size(191, 12); + this.lblPrompt.TabIndex = 2; + this.lblPrompt.Text = "补充描述 (可选,例如:背景要白色):"; + // + // txtAdditionalPrompt + // + this.txtAdditionalPrompt.Location = new System.Drawing.Point(30, 125); + this.txtAdditionalPrompt.Multiline = true; + this.txtAdditionalPrompt.Name = "txtAdditionalPrompt"; + this.txtAdditionalPrompt.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtAdditionalPrompt.Size = new System.Drawing.Size(370, 60); + this.txtAdditionalPrompt.TabIndex = 3; + // + // btnOk + // + this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOk.Location = new System.Drawing.Point(210, 210); + this.btnOk.Name = "btnOk"; + this.btnOk.Size = new System.Drawing.Size(90, 35); + this.btnOk.TabIndex = 4; + this.btnOk.Text = "生成图片"; + this.btnOk.UseVisualStyleBackColor = true; + this.btnOk.Click += new System.EventHandler(this.BtnOk_Click); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(310, 210); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(90, 35); + this.btnCancel.TabIndex = 5; + this.btnCancel.Text = "取消"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // ImageOptionsForm + // + this.AcceptButton = this.btnOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(450, 261); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOk); + this.Controls.Add(this.txtAdditionalPrompt); + this.Controls.Add(this.lblPrompt); + this.Controls.Add(this.cmbStyles); + this.Controls.Add(this.lblStyle); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; + this.Name = "ImageOptionsForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "生成配图设置"; + this.ResumeLayout(false); + this.PerformLayout(); - int startY = 30; - int gapY = 60; - int labelX = 30; - int inputX = 30; - int inputWidth = 370; - - // 1. 风格选择 - var lblStyle = new Label { Text = "图片风格:", Location = new Point(labelX, startY), AutoSize = true }; - cmbStyles = new ComboBox { Location = new Point(inputX, startY + 25), Width = inputWidth, DropDownStyle = ComboBoxStyle.DropDownList }; - - // 2. 补充描述 - var lblPrompt = new Label { Text = "补充描述 (可选,例如:背景要白色):", Location = new Point(labelX, startY + gapY + 10), AutoSize = true }; - txtAdditionalPrompt = new TextBox { Location = new Point(inputX, startY + gapY + 35), Width = inputWidth, Height = 60, Multiline = true, ScrollBars = ScrollBars.Vertical }; - // txtAdditionalPrompt.PlaceholderText = "例如:背景要白色,色调偏蓝..."; - - // Buttons - btnOk = new Button { Text = "生成图片", Location = new Point(210, 210), Width = 90, Height = 35, DialogResult = DialogResult.OK }; - btnOk.Click += BtnOk_Click; - - btnCancel = new Button { Text = "取消", Location = new Point(310, 210), Width = 90, Height = 35, DialogResult = DialogResult.Cancel }; - - this.Controls.Add(lblStyle); - this.Controls.Add(cmbStyles); - this.Controls.Add(lblPrompt); - this.Controls.Add(txtAdditionalPrompt); - this.Controls.Add(btnOk); - this.Controls.Add(btnCancel); - - this.AcceptButton = btnOk; - this.CancelButton = btnCancel; } private void InitializeStyles() diff --git a/WordAddIn/WordAddIn/LoadingForm.cs b/WordAddIn/WordAddIn/LoadingForm.cs index 9713555..2b81631 100644 --- a/WordAddIn/WordAddIn/LoadingForm.cs +++ b/WordAddIn/WordAddIn/LoadingForm.cs @@ -7,8 +7,9 @@ namespace WordAddIn { public class LoadingForm : Form { - private Label lblMessage; - private Timer animationTimer; + private System.Windows.Forms.Label lblMessage; + private System.Windows.Forms.Timer animationTimer; + private System.ComponentModel.IContainer components; private int _spinnerAngle = 0; private const int SPINNER_SIZE = 60; @@ -16,51 +17,58 @@ namespace WordAddIn private readonly Color _primaryColor = Color.FromArgb(43, 87, 154); // Word Blue private readonly Color _backgroundColor = Color.White; private readonly Color _borderColor = Color.FromArgb(100, 100, 100); - private readonly Font _textFont = new Font("Microsoft YaHei UI", 12F, FontStyle.Regular, GraphicsUnit.Point); - + public LoadingForm(string message = "AI 正在思考中...") { - InitializeComponent(message); + InitializeComponent(); + lblMessage.Text = message; // 开启双缓冲以减少闪烁 this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); this.UpdateStyles(); - this.Text = "AI助手"; } - private void InitializeComponent(string message) + private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); + this.lblMessage = new System.Windows.Forms.Label(); + this.animationTimer = new System.Windows.Forms.Timer(this.components); this.SuspendLayout(); - - // Form settings - this.FormBorderStyle = FormBorderStyle.None; - this.StartPosition = FormStartPosition.CenterScreen; - this.Size = new Size(500, 250); - this.BackColor = _backgroundColor; - this.TopMost = true; - this.ShowInTaskbar = false; - - // Timer - animationTimer = new Timer(); - animationTimer.Interval = 30; // 33fps - animationTimer.Tick += AnimationTimer_Tick; - animationTimer.Start(); - - // Label - this.lblMessage = new Label(); - this.lblMessage.Text = message; - this.lblMessage.AutoSize = false; - this.lblMessage.TextAlign = ContentAlignment.TopCenter; - this.lblMessage.Dock = DockStyle.None; - this.lblMessage.Width = this.Width; - this.lblMessage.Height = 40; - this.lblMessage.Location = new Point(0, 160); // 放在 Spinner 下方 - this.lblMessage.Font = _textFont; - this.lblMessage.ForeColor = Color.FromArgb(64, 64, 64); - this.lblMessage.BackColor = Color.Transparent; // 背景透明,防止遮挡边框 - + // + // lblMessage + // + this.lblMessage.BackColor = System.Drawing.Color.Transparent; + this.lblMessage.Dock = System.Windows.Forms.DockStyle.None; + this.lblMessage.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.lblMessage.Location = new System.Drawing.Point(0, 160); + this.lblMessage.Name = "lblMessage"; + this.lblMessage.Size = new System.Drawing.Size(500, 40); + this.lblMessage.TabIndex = 0; + this.lblMessage.Text = "AI 正在思考中..."; + this.lblMessage.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // + // animationTimer + // + this.animationTimer.Enabled = true; + this.animationTimer.Interval = 30; + this.animationTimer.Tick += new System.EventHandler(this.AnimationTimer_Tick); + // + // LoadingForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(500, 250); this.Controls.Add(this.lblMessage); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "LoadingForm"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "AI助手"; + this.TopMost = true; this.ResumeLayout(false); + } private void AnimationTimer_Tick(object sender, EventArgs e) diff --git a/WordAddIn/WordAddIn/LoginForm.cs b/WordAddIn/WordAddIn/LoginForm.cs index 572849b..0845519 100644 --- a/WordAddIn/WordAddIn/LoginForm.cs +++ b/WordAddIn/WordAddIn/LoginForm.cs @@ -10,6 +10,9 @@ namespace WordAddIn private TextBox txtPassword; private Button btnLogin; private Button btnCancel; + private Label lblTitle; + private Label lblUser; + private Label lblPass; public LoginForm() { @@ -18,80 +21,118 @@ namespace WordAddIn private void InitializeComponent() { - this.Text = "AI助手 - 用户登录"; - this.Size = new Size(500, 320); // 增大尺寸 - this.StartPosition = FormStartPosition.CenterScreen; - this.FormBorderStyle = FormBorderStyle.FixedDialog; + this.lblTitle = new System.Windows.Forms.Label(); + this.lblUser = new System.Windows.Forms.Label(); + this.txtUsername = new System.Windows.Forms.TextBox(); + this.lblPass = new System.Windows.Forms.Label(); + this.txtPassword = new System.Windows.Forms.TextBox(); + this.btnLogin = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lblTitle + // + this.lblTitle.AutoSize = false; + this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Bold); + this.lblTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(87)))), ((int)(((byte)(154))))); + this.lblTitle.Location = new System.Drawing.Point(0, 25); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(500, 40); + this.lblTitle.TabIndex = 0; + this.lblTitle.Text = "AI助手"; + this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblUser + // + this.lblUser.AutoSize = true; + this.lblUser.Font = new System.Drawing.Font("微软雅黑", 11F); + this.lblUser.Location = new System.Drawing.Point(80, 85); + this.lblUser.Name = "lblUser"; + this.lblUser.Size = new System.Drawing.Size(63, 20); + this.lblUser.TabIndex = 1; + this.lblUser.Text = "用户名:"; + // + // txtUsername + // + this.txtUsername.Font = new System.Drawing.Font("微软雅黑", 11F); + this.txtUsername.Location = new System.Drawing.Point(160, 80); + this.txtUsername.Name = "txtUsername"; + this.txtUsername.Size = new System.Drawing.Size(220, 27); + this.txtUsername.TabIndex = 2; + this.txtUsername.Text = "huanghai"; + // + // lblPass + // + this.lblPass.AutoSize = true; + this.lblPass.Font = new System.Drawing.Font("微软雅黑", 11F); + this.lblPass.Location = new System.Drawing.Point(80, 145); + this.lblPass.Name = "lblPass"; + this.lblPass.Size = new System.Drawing.Size(58, 20); + this.lblPass.TabIndex = 3; + this.lblPass.Text = "密 码:"; + // + // txtPassword + // + this.txtPassword.Font = new System.Drawing.Font("微软雅黑", 11F); + this.txtPassword.Location = new System.Drawing.Point(160, 140); + this.txtPassword.Name = "txtPassword"; + this.txtPassword.PasswordChar = '●'; + this.txtPassword.Size = new System.Drawing.Size(220, 27); + this.txtPassword.TabIndex = 4; + this.txtPassword.Text = "12345678"; + // + // btnLogin + // + this.btnLogin.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(87)))), ((int)(((byte)(154))))); + this.btnLogin.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnLogin.FlatAppearance.BorderSize = 0; + this.btnLogin.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnLogin.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Bold); + this.btnLogin.ForeColor = System.Drawing.Color.White; + this.btnLogin.Location = new System.Drawing.Point(110, 220); + this.btnLogin.Name = "btnLogin"; + this.btnLogin.Size = new System.Drawing.Size(120, 40); + this.btnLogin.TabIndex = 5; + this.btnLogin.Text = "立即登录"; + this.btnLogin.UseVisualStyleBackColor = false; + this.btnLogin.Click += new System.EventHandler(this.BtnLogin_Click); + // + // btnCancel + // + this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 10F); + this.btnCancel.Location = new System.Drawing.Point(250, 220); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(120, 40); + this.btnCancel.TabIndex = 6; + this.btnCancel.Text = "取消"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // LoginForm + // + this.AcceptButton = this.btnLogin; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(500, 320); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnLogin); + this.Controls.Add(this.txtPassword); + this.Controls.Add(this.lblPass); + this.Controls.Add(this.txtUsername); + this.Controls.Add(this.lblUser); + this.Controls.Add(this.lblTitle); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; - this.BackColor = Color.White; + this.Name = "LoginForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "AI助手 - 用户登录"; + this.ResumeLayout(false); + this.PerformLayout(); - // 调整布局参数 - int startY = 80; - int gapY = 60; - int labelX = 80; - int inputX = 160; - int inputWidth = 220; - - // 标题区域 - Label lblTitle = new Label - { - Text = "AI助手", - Font = new Font("微软雅黑", 16, FontStyle.Bold), - Location = new Point(0, 25), - AutoSize = false, - Width = 500, - Height = 40, - TextAlign = ContentAlignment.MiddleCenter, - ForeColor = Color.FromArgb(43, 87, 154) - }; - this.Controls.Add(lblTitle); - - // 1. 用户名 - var lblUser = new Label { Text = "用户名:", Location = new Point(labelX, startY + 5), AutoSize = true, Font = new Font("微软雅黑", 11) }; - txtUsername = new TextBox { Location = new Point(inputX, startY), Width = inputWidth, Font = new Font("微软雅黑", 11), Text = "huanghai" }; - - // 2. 密码 - var lblPass = new Label { Text = "密 码:", Location = new Point(labelX, startY + gapY + 5), AutoSize = true, Font = new Font("微软雅黑", 11) }; - txtPassword = new TextBox { Location = new Point(inputX, startY + gapY), Width = inputWidth, Font = new Font("微软雅黑", 11), PasswordChar = '●', Text = "12345678" }; - - // Buttons - btnLogin = new Button - { - Text = "立即登录", - Location = new Point(110, 220), - Width = 120, - Height = 40, - BackColor = Color.FromArgb(43, 87, 154), - ForeColor = Color.White, - FlatStyle = FlatStyle.Flat, - DialogResult = DialogResult.None, - Font = new Font("微软雅黑", 10, FontStyle.Bold), - Cursor = Cursors.Hand - }; - btnLogin.FlatAppearance.BorderSize = 0; - btnLogin.Click += BtnLogin_Click; - - btnCancel = new Button - { - Text = "取消", - Location = new Point(250, 220), - Width = 120, - Height = 40, - DialogResult = DialogResult.Cancel, - Font = new Font("微软雅黑", 10), - Cursor = Cursors.Hand - }; - - this.Controls.Add(lblUser); - this.Controls.Add(txtUsername); - this.Controls.Add(lblPass); - this.Controls.Add(txtPassword); - this.Controls.Add(btnLogin); - this.Controls.Add(btnCancel); - - this.AcceptButton = btnLogin; - this.CancelButton = btnCancel; } private void BtnLogin_Click(object sender, EventArgs e) diff --git a/WordAddIn/WordAddIn/ReferenceGeneratorForm.cs b/WordAddIn/WordAddIn/ReferenceGeneratorForm.cs index 87d938c..b8ca892 100644 --- a/WordAddIn/WordAddIn/ReferenceGeneratorForm.cs +++ b/WordAddIn/WordAddIn/ReferenceGeneratorForm.cs @@ -16,6 +16,9 @@ namespace WordAddIn private NumericUpDown numWordCount; private Button btnGenerate; private Button btnCancel; + private Label lblFileTip; + private Label lblWordCount; + private Label lblWordUnit; public string ReferenceContent { get; private set; } public int WordLimit { get; private set; } @@ -29,141 +32,207 @@ namespace WordAddIn private void InitializeComponent() { - this.Text = "素材写作 - AI助手"; - this.Size = new Size(650, 520); // 增大尺寸 - this.StartPosition = FormStartPosition.CenterScreen; - this.FormBorderStyle = FormBorderStyle.FixedDialog; + this.tabControl = new System.Windows.Forms.TabControl(); + this.tabFile = new System.Windows.Forms.TabPage(); + this.lblFileTip = new System.Windows.Forms.Label(); + this.txtFilePath = new System.Windows.Forms.TextBox(); + this.btnBrowse = new System.Windows.Forms.Button(); + this.tabText = new System.Windows.Forms.TabPage(); + this.txtReferenceInput = new System.Windows.Forms.RichTextBox(); + this.lblWordCount = new System.Windows.Forms.Label(); + this.numWordCount = new System.Windows.Forms.NumericUpDown(); + this.lblWordUnit = new System.Windows.Forms.Label(); + this.btnGenerate = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.tabControl.SuspendLayout(); + this.tabFile.SuspendLayout(); + this.tabText.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numWordCount)).BeginInit(); + this.SuspendLayout(); + // + // tabControl + // + this.tabControl.Controls.Add(this.tabFile); + this.tabControl.Controls.Add(this.tabText); + this.tabControl.Font = new System.Drawing.Font("微软雅黑", 11F); + this.tabControl.Location = new System.Drawing.Point(25, 25); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(585, 300); + this.tabControl.TabIndex = 0; + // + // tabFile + // + this.tabFile.BackColor = System.Drawing.Color.White; + this.tabFile.Controls.Add(this.lblFileTip); + this.tabFile.Controls.Add(this.txtFilePath); + this.tabFile.Controls.Add(this.btnBrowse); + this.tabFile.Location = new System.Drawing.Point(4, 29); + this.tabFile.Name = "tabFile"; + this.tabFile.Padding = new System.Windows.Forms.Padding(3); + this.tabFile.Size = new System.Drawing.Size(577, 267); + this.tabFile.TabIndex = 0; + this.tabFile.Text = "上传文档"; + // + // lblFileTip + // + this.lblFileTip.AutoSize = true; + this.lblFileTip.Font = new System.Drawing.Font("微软雅黑", 12F); + this.lblFileTip.Location = new System.Drawing.Point(30, 60); + this.lblFileTip.Name = "lblFileTip"; + this.lblFileTip.Size = new System.Drawing.Size(255, 21); + this.lblFileTip.TabIndex = 0; + this.lblFileTip.Text = "请选择参考文档 (支持 Word/Txt):"; + // + // txtFilePath + // + this.txtFilePath.Font = new System.Drawing.Font("微软雅黑", 11F); + this.txtFilePath.Location = new System.Drawing.Point(30, 100); + this.txtFilePath.Name = "txtFilePath"; + this.txtFilePath.ReadOnly = true; + this.txtFilePath.Size = new System.Drawing.Size(400, 27); + this.txtFilePath.TabIndex = 1; + // + // btnBrowse + // + this.btnBrowse.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnBrowse.Font = new System.Drawing.Font("微软雅黑", 10F); + this.btnBrowse.Location = new System.Drawing.Point(440, 98); + this.btnBrowse.Name = "btnBrowse"; + this.btnBrowse.Size = new System.Drawing.Size(100, 35); + this.btnBrowse.TabIndex = 2; + this.btnBrowse.Text = "浏览..."; + this.btnBrowse.UseVisualStyleBackColor = true; + this.btnBrowse.Click += new System.EventHandler(this.BtnBrowse_Click); + // + // tabText + // + this.tabText.BackColor = System.Drawing.Color.White; + this.tabText.Controls.Add(this.txtReferenceInput); + this.tabText.Location = new System.Drawing.Point(4, 29); + this.tabText.Name = "tabText"; + this.tabText.Padding = new System.Windows.Forms.Padding(10); + this.tabText.Size = new System.Drawing.Size(577, 267); + this.tabText.TabIndex = 1; + this.tabText.Text = "直接输入"; + // + // txtReferenceInput + // + this.txtReferenceInput.BackColor = System.Drawing.Color.WhiteSmoke; + this.txtReferenceInput.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.txtReferenceInput.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtReferenceInput.Font = new System.Drawing.Font("微软雅黑", 11F); + this.txtReferenceInput.Location = new System.Drawing.Point(10, 10); + this.txtReferenceInput.Name = "txtReferenceInput"; + this.txtReferenceInput.Size = new System.Drawing.Size(557, 247); + this.txtReferenceInput.TabIndex = 0; + this.txtReferenceInput.Text = ""; + // + // lblWordCount + // + this.lblWordCount.AutoSize = true; + this.lblWordCount.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); + this.lblWordCount.Location = new System.Drawing.Point(30, 355); + this.lblWordCount.Name = "lblWordCount"; + this.lblWordCount.Size = new System.Drawing.Size(117, 22); + this.lblWordCount.TabIndex = 1; + this.lblWordCount.Text = "生成字数上限:"; + // + // numWordCount + // + this.numWordCount.Font = new System.Drawing.Font("微软雅黑", 14F); + this.numWordCount.Increment = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.numWordCount.Location = new System.Drawing.Point(200, 350); + this.numWordCount.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.numWordCount.Minimum = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.numWordCount.Name = "numWordCount"; + this.numWordCount.Size = new System.Drawing.Size(120, 32); + this.numWordCount.TabIndex = 2; + this.numWordCount.Value = new decimal(new int[] { + 500, + 0, + 0, + 0}); + // + // lblWordUnit + // + this.lblWordUnit.AutoSize = true; + this.lblWordUnit.Font = new System.Drawing.Font("微软雅黑", 12F); + this.lblWordUnit.Location = new System.Drawing.Point(330, 355); + this.lblWordUnit.Name = "lblWordUnit"; + this.lblWordUnit.Size = new System.Drawing.Size(26, 21); + this.lblWordUnit.TabIndex = 3; + this.lblWordUnit.Text = "字"; + // + // btnGenerate + // + this.btnGenerate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(87)))), ((int)(((byte)(154))))); + this.btnGenerate.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnGenerate.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnGenerate.FlatAppearance.BorderSize = 0; + this.btnGenerate.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnGenerate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); + this.btnGenerate.ForeColor = System.Drawing.Color.White; + this.btnGenerate.Location = new System.Drawing.Point(160, 410); + this.btnGenerate.Name = "btnGenerate"; + this.btnGenerate.Size = new System.Drawing.Size(140, 45); + this.btnGenerate.TabIndex = 4; + this.btnGenerate.Text = "开始生成"; + this.btnGenerate.UseVisualStyleBackColor = false; + this.btnGenerate.Click += new System.EventHandler(this.BtnGenerate_Click); + // + // btnCancel + // + this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F); + this.btnCancel.Location = new System.Drawing.Point(320, 410); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(140, 45); + this.btnCancel.TabIndex = 5; + this.btnCancel.Text = "取消"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // ReferenceGeneratorForm + // + this.AcceptButton = this.btnGenerate; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(650, 520); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnGenerate); + this.Controls.Add(this.lblWordUnit); + this.Controls.Add(this.numWordCount); + this.Controls.Add(this.lblWordCount); + this.Controls.Add(this.tabControl); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; - this.BackColor = Color.White; + this.Name = "ReferenceGeneratorForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "素材写作 - AI助手"; + this.tabControl.ResumeLayout(false); + this.tabFile.ResumeLayout(false); + this.tabFile.PerformLayout(); + this.tabText.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numWordCount)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); - // 1. 选项卡控件 - tabControl = new TabControl - { - Location = new Point(25, 25), - Size = new Size(585, 300), // 增大尺寸 - Font = new Font("微软雅黑", 11) // 增大字体 - }; - - // Tab 1: 文本输入 - tabText = new TabPage("直接输入"); - tabText.BackColor = Color.White; - tabText.Padding = new Padding(10); - txtReferenceInput = new RichTextBox - { - Dock = DockStyle.Fill, - BorderStyle = BorderStyle.None, - Font = new Font("微软雅黑", 11), - BackColor = Color.WhiteSmoke, - Text = "" - }; - tabText.Controls.Add(txtReferenceInput); - - // Tab 2: 文件上传 - tabFile = new TabPage("上传文档"); - tabFile.BackColor = Color.White; - - Label lblFileTip = new Label - { - Text = "请选择参考文档 (支持 Word/Txt):", - Location = new Point(30, 60), - AutoSize = true, - Font = new Font("微软雅黑", 12) - }; - - txtFilePath = new TextBox - { - Location = new Point(30, 100), - Width = 400, // 变宽 - Height = 30, - ReadOnly = true, - Font = new Font("微软雅黑", 11) - }; - - btnBrowse = new Button - { - Text = "浏览...", - Location = new Point(440, 98), - Width = 100, // 变大 - Height = 35, - Font = new Font("微软雅黑", 10), - Cursor = Cursors.Hand - }; - btnBrowse.Click += BtnBrowse_Click; - - tabFile.Controls.Add(lblFileTip); - tabFile.Controls.Add(txtFilePath); - tabFile.Controls.Add(btnBrowse); - - tabControl.Controls.Add(tabFile); - tabControl.Controls.Add(tabText); - - // 2. 字数限制区域 (显著优化) - int settingsY = 350; - Label lblWordCount = new Label - { - Text = "生成字数上限:", - Location = new Point(30, settingsY + 5), - AutoSize = true, - Font = new Font("微软雅黑", 12, FontStyle.Bold) // 加粗加大 - }; - - // 分开初始化以确保顺序和值正确 - numWordCount = new NumericUpDown(); - numWordCount.Location = new Point(200, settingsY); // 移到 200,避开标签 - numWordCount.Width = 120; - numWordCount.Font = new Font("微软雅黑", 14); - numWordCount.Minimum = 0; // 先重置范围 - numWordCount.Maximum = 10000; - numWordCount.Minimum = 100; - numWordCount.Increment = 100; - numWordCount.Value = 500; // 显式最后设置 - - Label lblWordUnit = new Label - { - Text = "字", - Location = new Point(330, settingsY + 5), // 跟着移动 - AutoSize = true, - Font = new Font("微软雅黑", 12) - }; - - // 3. 底部按钮 - btnGenerate = new Button - { - Text = "开始生成", - Location = new Point(160, 410), - Width = 140, - Height = 45, - BackColor = Color.FromArgb(43, 87, 154), - ForeColor = Color.White, - FlatStyle = FlatStyle.Flat, - DialogResult = DialogResult.OK, - Font = new Font("微软雅黑", 12, FontStyle.Bold), - Cursor = Cursors.Hand - }; - btnGenerate.FlatAppearance.BorderSize = 0; - btnGenerate.Click += BtnGenerate_Click; - - btnCancel = new Button - { - Text = "取消", - Location = new Point(320, 410), - Width = 140, - Height = 45, - DialogResult = DialogResult.Cancel, - Font = new Font("微软雅黑", 12), - Cursor = Cursors.Hand - }; - - this.Controls.Add(tabControl); - this.Controls.Add(lblWordCount); - this.Controls.Add(numWordCount); - this.Controls.Add(lblWordUnit); - this.Controls.Add(btnGenerate); - this.Controls.Add(btnCancel); - - this.AcceptButton = btnGenerate; - this.CancelButton = btnCancel; } private void BtnBrowse_Click(object sender, EventArgs e) diff --git a/WordAddIn/WordAddIn/ThisAddIn.cs b/WordAddIn/WordAddIn/ThisAddIn.cs index b4dad13..7840883 100644 --- a/WordAddIn/WordAddIn/ThisAddIn.cs +++ b/WordAddIn/WordAddIn/ThisAddIn.cs @@ -1,13 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml.Linq; -using Word = Microsoft.Office.Interop.Word; -using Office = Microsoft.Office.Core; -using Microsoft.Office.Tools.Word; - -namespace WordAddIn +namespace WordAddIn { public partial class ThisAddIn { diff --git a/WordAddIn/WordAddIn/WordAddIn.csproj b/WordAddIn/WordAddIn/WordAddIn.csproj index b79711c..ac08f0b 100644 --- a/WordAddIn/WordAddIn/WordAddIn.csproj +++ b/WordAddIn/WordAddIn/WordAddIn.csproj @@ -26,17 +26,40 @@ false WordAddIn WordAddIn - 3 v4.7.2 VSTO40;UseOfficeInterop - true - HomeSite true + False + true + publish\ + + zh-chs + 1.0.0.1 + true + true + 7 + days + WordAddIn + + + WordAddIn + + 3 + + False + Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + False - Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29 + Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 和 x64%29 true @@ -246,6 +269,9 @@ Form + + UserControl + ThisAddIn.cs @@ -278,8 +304,8 @@ - - + + diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll index 52549ac..ca6626f 100644 Binary files a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll and b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll differ diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest index 15e404b..555d244 100644 --- a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest +++ b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.dll.manifest @@ -1,6 +1,6 @@  - + WordAddIn @@ -166,14 +166,14 @@ - + - +twUOyk3hKDGs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mP6IyCiMQLuTkDPm01+ExgWzIxjufW0lOYEsr5KvXJsLMKKKx4qAYoz+hd3tIzB01lwKqvSwkXP1sY=23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=AQABMIICDTCCAXagAwIBAgIQJpSlsxfGbpRNgyjD5Q/yDjANBgkqhkiG9w0BAQsFADBFMUMwQQYDVQQDHjoARABFAFMASwBUAE8AUAAtAFEANgBIADcAQgA2AEwAXABBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByMB4XDTI2MDEyNDAwMzYxNVoXDTI3MDEyNDA2MzYxNVowRTFDMEEGA1UEAx46AEQARQBTAEsAVABPAFAALQBRADYASAA3AEIANgBMAFwAQQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaECAwEAATANBgkqhkiG9w0BAQsFAAOBgQC3GjWMhEFFrn9PGYrQVGNAaibG1sR/eRX3ZWNRjYLhiqbsdeHvm4CX/W0EWd9yZlbaej87XyeUbX+mC3q3yMFVPCRn/W65WYyBPbWTWmSfU9VLKKULAH6WqjS7CqEU3cQSuKcU6nYG4AJu2/FkQJaA82tr3pvcQD28HmOlDeNh0Q== \ No newline at end of file diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb index 88b7fd5..cd59581 100644 Binary files a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb and b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.pdb differ diff --git a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto index 3bf3aa4..fed3e92 100644 --- a/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto +++ b/WordAddIn/WordAddIn/bin/Debug/WordAddIn.vsto @@ -1,6 +1,6 @@  - + @@ -8,14 +8,14 @@ - + - lGR+g0G3oRh6CYqn4BOwswtXYIPtDSPLISmW3/6m/B4= + PPmVr+YsqgTyziCPQl2d+8CBQOBV0DzcZLxUnUr5dGA= -iEFRnZU9D2CuwgoEUx12Fub+u5LGVopuy6gF4w0Ypmw=bD/ev1Krz3V8Zujwd2WBrkPBzUVb4AbfI1GOxQCLHPGC4RmrUrCQmHEAKMoDIaYT6aNxokGccY+1uIanZA9RzYgLtIkHSPgO60hj/xDwQo/L7X/MgN6kyrcVpf4IivQxqMpC2guGEThoe7VlVPrcG1u2UFOsthLVcdVneHBw10s=23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPgAxkXaQS+La14Wp8GOwnM1qHNJwgla4VAIYjmCj3CUMXLsxspOFVZKRnB6/idYku4Gzhc7NjRBAwe8qWBXaE=AQABCN=DESKTOP-Q6H7B6L\Administrator4A3DJErRH421ddNaDY5wUhU7rnuNYWOJ6Uw0CbjdQtE=vrd8laleYqhCHvJEilCJMwBu1WXyuCICm1RySKI9KdKdcrV7F6Vuk+0H8uNDn3tyW6vKmUm4xHyjSUWHzjmpVP8SF6UpgHnCSy5MlVHsD+W2zwZpHp0RWmsa3l3xmA/R2ZIzWFH3lKc+Ris5DCWt6c95QpYrFTozHiI5tzGN11E=23ghUI75yy8GcLhPT5yA+v2ssRfSW+chNqMI+pq5OAr7RXQJOt/+bHdoT9NoS9GQkvblc7ekoUNShIcN601ZZOPg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VGNAaibG1sR/eRX3ZWNRjYLhiqbsdeHvm4CX/W0EWd9yZlbaej87XyeUbX+mC3q3yMFVPCRn/W65WYyBPbWTWmSfU9VLKKULAH6WqjS7CqEU3cQSuKcU6nYG4AJu2/FkQJaA82tr3pvcQD28HmOlDeNh0Q== \ No newline at end of file diff --git a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache index 5f70a88..a7b08d5 100644 --- a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache +++ b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -0d64e77cb4bdacc7f0baf6ddf9ef2f438b5bde539b8038cdf17f2259249243fd +3849c9896302f552ebedc5a2387b042475bb844b34c63a462d94d975303dd317 diff --git a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll index 52549ac..ca6626f 100644 Binary files a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll and b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.dll differ diff --git a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb index 88b7fd5..cd59581 100644 Binary files a/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb and b/WordAddIn/WordAddIn/obj/Debug/WordAddIn.pdb differ