为每个路径选择框添加粘贴按钮,支持从剪贴板直接粘贴路径: 1. 界面调整: - 调整文本框宽度以容纳额外按钮 - 添加绿色的粘贴按钮 - 重新排列浏览和粘贴按钮位置 2. 新增功能: - btnPasteSource_Click:粘贴PDF路径 - btnPasteText_Click:粘贴TXT源路径 - btnPasteOutput_Click:粘贴输出路径 3. 用户体验提升: - 支持Ctrl+C/CtrlV快捷操作 - 自动检测剪贴板内容 - 友好的错误提示 - 粘贴操作日志记录 现在用户可以更方便地输入路径,既可以通过浏览选择,也可以直接粘贴! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
296 lines
13 KiB
C#
296 lines
13 KiB
C#
using System;
|
||
using System.Drawing;
|
||
using System.Windows.Forms;
|
||
|
||
namespace SlideCombine
|
||
{
|
||
partial class Form1
|
||
{
|
||
/// <summary>
|
||
/// Required designer variable.
|
||
/// </summary>
|
||
private System.ComponentModel.IContainer components = null;
|
||
|
||
/// <summary>
|
||
/// Clean up any resources being used.
|
||
/// </summary>
|
||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||
protected override void Dispose(bool disposing)
|
||
{
|
||
if (disposing && (components != null))
|
||
{
|
||
components.Dispose();
|
||
}
|
||
base.Dispose(disposing);
|
||
}
|
||
|
||
#region Windows Form Designer generated code
|
||
|
||
/// <summary>
|
||
/// Required method for Designer support - do not modify
|
||
/// the contents of this method with the code editor.
|
||
/// </summary>
|
||
private void InitializeComponent()
|
||
{
|
||
components = new System.ComponentModel.Container();
|
||
|
||
// 主窗体设置
|
||
AutoScaleMode = AutoScaleMode.Font;
|
||
ClientSize = new Size(700, 650);
|
||
Text = "PDF书签合并工具 v1.0";
|
||
StartPosition = FormStartPosition.CenterScreen;
|
||
BackColor = Color.FromArgb(240, 240, 240);
|
||
|
||
// 创建控件
|
||
grpSourceFolder = new GroupBox();
|
||
lblSourcePath = new Label();
|
||
txtSourcePath = new TextBox();
|
||
btnBrowseSource = new Button();
|
||
|
||
grpTextFolder = new GroupBox();
|
||
lblTextPath = new Label();
|
||
txtTextPath = new TextBox();
|
||
btnBrowseText = new Button();
|
||
|
||
grpOutputFolder = new GroupBox();
|
||
lblOutputPath = new Label();
|
||
txtOutputPath = new TextBox();
|
||
btnBrowseOutput = new Button();
|
||
|
||
pnlButtons = new Panel();
|
||
btnMerge = new Button();
|
||
btnClear = new Button();
|
||
btnExit = new Button();
|
||
|
||
grpProgress = new GroupBox();
|
||
progressBar = new ProgressBar();
|
||
txtLog = new RichTextBox();
|
||
|
||
// 设置PDF文件夹组
|
||
grpSourceFolder.Text = "📁 PDF文件夹路径";
|
||
grpSourceFolder.Location = new Point(15, 15);
|
||
grpSourceFolder.Size = new Size(670, 70);
|
||
grpSourceFolder.TabStop = false;
|
||
grpSourceFolder.BackColor = Color.White;
|
||
grpSourceFolder.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
|
||
lblSourcePath.Text = "选择包含PDF文件夹的路径(含FreePic2Pdf_bkmk.txt文件):";
|
||
lblSourcePath.Location = new Point(15, 20);
|
||
lblSourcePath.Size = new Size(350, 20);
|
||
lblSourcePath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
|
||
txtSourcePath.Location = new Point(15, 40);
|
||
txtSourcePath.Size = new Size(480, 22);
|
||
txtSourcePath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
txtSourcePath.BorderStyle = BorderStyle.FixedSingle;
|
||
|
||
btnBrowseSource.Text = "浏览";
|
||
btnBrowseSource.Location = new Point(500, 39);
|
||
btnBrowseSource.Size = new Size(60, 24);
|
||
btnBrowseSource.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnBrowseSource.BackColor = Color.FromArgb(66, 139, 202);
|
||
btnBrowseSource.ForeColor = Color.White;
|
||
btnBrowseSource.FlatStyle = FlatStyle.Flat;
|
||
btnBrowseSource.FlatAppearance.BorderSize = 0;
|
||
btnBrowseSource.Click += new EventHandler(btnBrowseSource_Click);
|
||
|
||
var btnPasteSource = new Button();
|
||
btnPasteSource.Text = "粘贴";
|
||
btnPasteSource.Location = new Point(565, 39);
|
||
btnPasteSource.Size = new Size(60, 24);
|
||
btnPasteSource.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnPasteSource.BackColor = Color.FromArgb(92, 184, 92);
|
||
btnPasteSource.ForeColor = Color.White;
|
||
btnPasteSource.FlatStyle = FlatStyle.Flat;
|
||
btnPasteSource.FlatAppearance.BorderSize = 0;
|
||
btnPasteSource.Click += new EventHandler(btnPasteSource_Click);
|
||
|
||
grpSourceFolder.Controls.Add(lblSourcePath);
|
||
grpSourceFolder.Controls.Add(txtSourcePath);
|
||
grpSourceFolder.Controls.Add(btnBrowseSource);
|
||
grpSourceFolder.Controls.Add(btnPasteSource);
|
||
|
||
// 设置TXT文件夹组
|
||
grpTextFolder.Text = "📄 TXT源文件路径";
|
||
grpTextFolder.Location = new Point(15, 90);
|
||
grpTextFolder.Size = new Size(670, 70);
|
||
grpTextFolder.TabStop = false;
|
||
grpTextFolder.BackColor = Color.White;
|
||
grpTextFolder.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
|
||
lblTextPath.Text = "选择包含元数据TXT文件的路径:";
|
||
lblTextPath.Location = new Point(15, 20);
|
||
lblTextPath.Size = new Size(350, 20);
|
||
lblTextPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
|
||
txtTextPath.Location = new Point(15, 40);
|
||
txtTextPath.Size = new Size(480, 22);
|
||
txtTextPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
txtTextPath.BorderStyle = BorderStyle.FixedSingle;
|
||
|
||
btnBrowseText.Text = "浏览";
|
||
btnBrowseText.Location = new Point(500, 39);
|
||
btnBrowseText.Size = new Size(60, 24);
|
||
btnBrowseText.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnBrowseText.BackColor = Color.FromArgb(66, 139, 202);
|
||
btnBrowseText.ForeColor = Color.White;
|
||
btnBrowseText.FlatStyle = FlatStyle.Flat;
|
||
btnBrowseText.FlatAppearance.BorderSize = 0;
|
||
btnBrowseText.Click += new EventHandler(btnBrowseText_Click);
|
||
|
||
var btnPasteText = new Button();
|
||
btnPasteText.Text = "粘贴";
|
||
btnPasteText.Location = new Point(565, 39);
|
||
btnPasteText.Size = new Size(60, 24);
|
||
btnPasteText.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnPasteText.BackColor = Color.FromArgb(92, 184, 92);
|
||
btnPasteText.ForeColor = Color.White;
|
||
btnPasteText.FlatStyle = FlatStyle.Flat;
|
||
btnPasteText.FlatAppearance.BorderSize = 0;
|
||
btnPasteText.Click += new EventHandler(btnPasteText_Click);
|
||
|
||
grpTextFolder.Controls.Add(lblTextPath);
|
||
grpTextFolder.Controls.Add(txtTextPath);
|
||
grpTextFolder.Controls.Add(btnBrowseText);
|
||
grpTextFolder.Controls.Add(btnPasteText);
|
||
|
||
// 设置输出文件夹组
|
||
grpOutputFolder.Text = "💾 最终输出路径";
|
||
grpOutputFolder.Location = new Point(15, 165);
|
||
grpOutputFolder.Size = new Size(670, 70);
|
||
grpOutputFolder.TabStop = false;
|
||
grpOutputFolder.BackColor = Color.White;
|
||
grpOutputFolder.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
|
||
lblOutputPath.Text = "选择合并后TXT文件的输出路径:";
|
||
lblOutputPath.Location = new Point(15, 20);
|
||
lblOutputPath.Size = new Size(350, 20);
|
||
lblOutputPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
|
||
txtOutputPath.Location = new Point(15, 40);
|
||
txtOutputPath.Size = new Size(480, 22);
|
||
txtOutputPath.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
txtOutputPath.BorderStyle = BorderStyle.FixedSingle;
|
||
|
||
btnBrowseOutput.Text = "浏览";
|
||
btnBrowseOutput.Location = new Point(500, 39);
|
||
btnBrowseOutput.Size = new Size(60, 24);
|
||
btnBrowseOutput.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnBrowseOutput.BackColor = Color.FromArgb(66, 139, 202);
|
||
btnBrowseOutput.ForeColor = Color.White;
|
||
btnBrowseOutput.FlatStyle = FlatStyle.Flat;
|
||
btnBrowseOutput.FlatAppearance.BorderSize = 0;
|
||
btnBrowseOutput.Click += new EventHandler(btnBrowseOutput_Click);
|
||
|
||
var btnPasteOutput = new Button();
|
||
btnPasteOutput.Text = "粘贴";
|
||
btnPasteOutput.Location = new Point(565, 39);
|
||
btnPasteOutput.Size = new Size(60, 24);
|
||
btnPasteOutput.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnPasteOutput.BackColor = Color.FromArgb(92, 184, 92);
|
||
btnPasteOutput.ForeColor = Color.White;
|
||
btnPasteOutput.FlatStyle = FlatStyle.Flat;
|
||
btnPasteOutput.FlatAppearance.BorderSize = 0;
|
||
btnPasteOutput.Click += new EventHandler(btnPasteOutput_Click);
|
||
|
||
grpOutputFolder.Controls.Add(lblOutputPath);
|
||
grpOutputFolder.Controls.Add(txtOutputPath);
|
||
grpOutputFolder.Controls.Add(btnBrowseOutput);
|
||
grpOutputFolder.Controls.Add(btnPasteOutput);
|
||
|
||
// 设置按钮面板
|
||
pnlButtons.Location = new Point(15, 240);
|
||
pnlButtons.Size = new Size(670, 50);
|
||
pnlButtons.BackColor = Color.Transparent;
|
||
|
||
btnMerge.Text = "🚀 开始合并";
|
||
btnMerge.Location = new Point(15, 10);
|
||
btnMerge.Size = new Size(120, 30);
|
||
btnMerge.Font = new Font("Microsoft YaHei", 10F, FontStyle.Bold);
|
||
btnMerge.BackColor = Color.FromArgb(92, 184, 92);
|
||
btnMerge.ForeColor = Color.White;
|
||
btnMerge.FlatStyle = FlatStyle.Flat;
|
||
btnMerge.FlatAppearance.BorderSize = 0;
|
||
btnMerge.Click += new EventHandler(btnMerge_Click);
|
||
|
||
btnClear.Text = "🔄 清空";
|
||
btnClear.Location = new Point(145, 10);
|
||
btnClear.Size = new Size(100, 30);
|
||
btnClear.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnClear.BackColor = Color.FromArgb(240, 173, 78);
|
||
btnClear.ForeColor = Color.White;
|
||
btnClear.FlatStyle = FlatStyle.Flat;
|
||
btnClear.FlatAppearance.BorderSize = 0;
|
||
btnClear.Click += new EventHandler(btnClear_Click);
|
||
|
||
btnExit.Text = "❌ 退出";
|
||
btnExit.Location = new Point(255, 10);
|
||
btnExit.Size = new Size(100, 30);
|
||
btnExit.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
btnExit.BackColor = Color.FromArgb(217, 83, 79);
|
||
btnExit.ForeColor = Color.White;
|
||
btnExit.FlatStyle = FlatStyle.Flat;
|
||
btnExit.FlatAppearance.BorderSize = 0;
|
||
btnExit.Click += new EventHandler(btnExit_Click);
|
||
|
||
pnlButtons.Controls.Add(btnMerge);
|
||
pnlButtons.Controls.Add(btnClear);
|
||
pnlButtons.Controls.Add(btnExit);
|
||
|
||
// 设置进度组
|
||
grpProgress.Text = "📊 处理进度";
|
||
grpProgress.Location = new Point(15, 295);
|
||
grpProgress.Size = new Size(670, 280);
|
||
grpProgress.TabStop = false;
|
||
grpProgress.BackColor = Color.White;
|
||
grpProgress.Font = new Font("Microsoft YaHei", 9F, FontStyle.Regular);
|
||
|
||
progressBar.Location = new Point(15, 25);
|
||
progressBar.Size = new Size(640, 25);
|
||
progressBar.Style = ProgressBarStyle.Continuous;
|
||
progressBar.ForeColor = Color.FromArgb(66, 139, 202);
|
||
|
||
txtLog.Location = new Point(15, 60);
|
||
txtLog.Size = new Size(640, 200);
|
||
txtLog.Multiline = true;
|
||
txtLog.ScrollBars = RichTextBoxScrollBars.Vertical;
|
||
txtLog.ReadOnly = true;
|
||
txtLog.Font = new Font("Consolas", 9F, FontStyle.Regular);
|
||
txtLog.BackColor = Color.FromArgb(248, 248, 248);
|
||
txtLog.BorderStyle = BorderStyle.FixedSingle;
|
||
|
||
grpProgress.Controls.Add(progressBar);
|
||
grpProgress.Controls.Add(txtLog);
|
||
|
||
// 添加所有控件到窗体
|
||
Controls.Add(grpSourceFolder);
|
||
Controls.Add(grpTextFolder);
|
||
Controls.Add(grpOutputFolder);
|
||
Controls.Add(pnlButtons);
|
||
Controls.Add(grpProgress);
|
||
}
|
||
|
||
#endregion
|
||
|
||
private GroupBox grpSourceFolder;
|
||
private Label lblSourcePath;
|
||
private TextBox txtSourcePath;
|
||
private Button btnBrowseSource;
|
||
private GroupBox grpTextFolder;
|
||
private Label lblTextPath;
|
||
private TextBox txtTextPath;
|
||
private Button btnBrowseText;
|
||
private GroupBox grpOutputFolder;
|
||
private Label lblOutputPath;
|
||
private TextBox txtOutputPath;
|
||
private Button btnBrowseOutput;
|
||
private Panel pnlButtons;
|
||
private Button btnMerge;
|
||
private Button btnClear;
|
||
private Button btnExit;
|
||
private GroupBox grpProgress;
|
||
private ProgressBar progressBar;
|
||
private RichTextBox txtLog;
|
||
}
|
||
}
|