⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mbookmaker.cs.bak

📁 用VC.NET开发的应用于Symbian上的电子书开发源代码.
💻 BAK
📖 第 1 页 / 共 4 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Drawing.Imaging;

namespace mBookMaker
{
	/// <summary>
	/// mBookMaker 的摘要说明。
	/// </summary>
	public class mBookMaker : System.Windows.Forms.Form
	{
		//*****************************************************************
		/// <summary>
		/// 用户自己定义的变量
		/// </summary>
		private int iTotalen;
		private ArrayList iChapStr;
		private string iCoverFile;
		private Image myCover;
		private ArrayList iChapter;
		private bool iModified;
		private string[] GENDERS;
		private int iLastSelected;
		private int iType;//书类型0-普通书,1-漫画书
		private MhPreview fromMhPreview;
		// 漫画书使用结构
		//[StructLayout(LayoutKind.Sequential)]
		private struct MHChapter
		{
			public string ChapterStr;
			public ArrayList JpgFileNameArray;
		}
		private ArrayList MHChapterArray;
		//*****************************************************************
		private System.Windows.Forms.TabControl tabs;
		private System.Windows.Forms.TabPage tabInfo;
		private System.Windows.Forms.TabPage tabCover;
		private System.Windows.Forms.TabPage tabText;
		private System.Windows.Forms.TabPage tabMake;
		private System.Windows.Forms.TabPage tabAbout;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label lbInfo;
		private System.Windows.Forms.TextBox tbTitle;
		private System.Windows.Forms.TextBox tbAuthor;
		private System.Windows.Forms.TextBox tbPublisher;
		private System.Windows.Forms.DateTimePicker dtpDate;
		private System.Windows.Forms.ComboBox cbGender;
		private System.Windows.Forms.Button btOpenDir;
		private System.Windows.Forms.PictureBox pbPreview;
		private System.Windows.Forms.Button btSelCover;
		private System.Windows.Forms.Button btDefCover;
		private System.Windows.Forms.Label lbDefCover;
		private System.Windows.Forms.ListBox lbChapters;
		private System.Windows.Forms.TextBox tbCurrChapStr;
		private System.Windows.Forms.TextBox tbText;
		private System.Windows.Forms.Button btAddChap;
		private System.Windows.Forms.Button btRenChap;
		private System.Windows.Forms.Button btDelChap;
		private System.Windows.Forms.Button btAddFile;
		private System.Windows.Forms.Label lbModified;
		private System.Windows.Forms.Button btPaste;
		private System.Windows.Forms.ListBox lbCheckList;
		private System.Windows.Forms.ProgressBar pbar;
		private System.Windows.Forms.Button btGO;
		private System.Windows.Forms.FolderBrowserDialog dlgOpenDir;
		private System.Windows.Forms.TextBox tbSaveTo;
		private System.Windows.Forms.Label lbAbout;
		private System.Windows.Forms.OpenFileDialog dlgOpenFile;
		private System.Windows.Forms.MainMenu mBookMenu;
		private System.Windows.Forms.MenuItem menuItem1;
		private System.Windows.Forms.MenuItem menuItem2;
		private System.Windows.Forms.MenuItem menuItem3;
		private System.Windows.Forms.MenuItem menuItem5;
		private System.Windows.Forms.MenuItem menuItem6;
		private System.Windows.Forms.MenuItem menuItem7;
		private System.Windows.Forms.ComboBox cbType;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.TabPage tabImage;
		private System.Windows.Forms.MenuItem menuItemAbout;
		private System.Windows.Forms.MenuItem menuItemExit;
		private System.Windows.Forms.CheckBox checkUserChap;
		private System.Windows.Forms.TextBox tbMhCurrChapStr;
		private System.Windows.Forms.ListBox lbMhChapters;
		private System.Windows.Forms.Button btMhDelChap;
		private System.Windows.Forms.Button btMhRenChap;
		private System.Windows.Forms.Button btMhAddChap;
		private System.Windows.Forms.TextBox tbMhText;
		private System.Windows.Forms.CheckBox checkUserText;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button btJpgDel;
		private System.Windows.Forms.Button btJpgAdd;
		private System.Windows.Forms.ListBox lbJpgFile;
		private System.Windows.Forms.Button btJpgClear;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public mBookMaker()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
			this.iChapter = new ArrayList();
			this.iChapStr = new ArrayList();
			string[] textArray1 = new string[0x12] {"现代文学", "网络文学", "古代文学", 
													"武侠小说", "外国文学", "外文原著", 
													"生活读物", "电脑知识", "法律典籍", 
													"科学教育", "金融财经", "体育故事", 
													"情爱文学", "军事谋略", "历史轶闻", 
													"地理风情",	"哲学宗教", "其他类别"};
			this.GENDERS = textArray1;
			textArray1 = this.GENDERS;
			for (int num1 = 0; num1 < textArray1.Length; num1++)
			{
				string text1 = textArray1[num1];
				this.cbGender.Items.Add(text1);
			}
			this.cbGender.SelectedIndex = 0;
			string[] textArray2 = new string[2]{"普通书","漫画书"};//,"漫画书"};
			for (int num1 = 0; num1<textArray2.Length;num1++)
			{
				this.cbType.Items.Add(textArray2[num1]);
			}
			this.cbType.SelectedIndex = 0;
			this.lbInfo.Text = "注:以上各条最多可输入50个字,\r\n请尽量保证基本信息内容的正确性,\r\n以有利于他人使用和进行管理。\r\n";
			this.lbAbout.Text = "浪子工作室\r\n\r\n随时随地  享受阅读\r\nmBookMaker Ver 1.0 \r\n\r\n手机电子图书文档制作/转换工具\r\n\r\n(C)版权所有 浪子工作室 2005\r\n";
			this.iCoverFile = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Remove(0, 8)) + @"\cover.jpg";
			this.lbAbout.Left = (this.tabAbout.Width - this.lbAbout.Width) / 2;
			this.tbSaveTo.Text = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Remove(0, 8));
			object[] objArray1 = new object[1] { "<添加目录标题...>"};
			this.lbChapters.Items.AddRange(objArray1);
			this.fromMhPreview = new MhPreview();
			this.MHChapterArray = new ArrayList();
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.tabs = new System.Windows.Forms.TabControl();
			this.tabInfo = new System.Windows.Forms.TabPage();
			this.cbType = new System.Windows.Forms.ComboBox();
			this.label7 = new System.Windows.Forms.Label();
			this.btOpenDir = new System.Windows.Forms.Button();
			this.cbGender = new System.Windows.Forms.ComboBox();
			this.dtpDate = new System.Windows.Forms.DateTimePicker();
			this.tbSaveTo = new System.Windows.Forms.TextBox();
			this.tbPublisher = new System.Windows.Forms.TextBox();
			this.tbAuthor = new System.Windows.Forms.TextBox();
			this.tbTitle = new System.Windows.Forms.TextBox();
			this.lbInfo = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.tabCover = new System.Windows.Forms.TabPage();
			this.lbDefCover = new System.Windows.Forms.Label();
			this.btDefCover = new System.Windows.Forms.Button();
			this.btSelCover = new System.Windows.Forms.Button();
			this.pbPreview = new System.Windows.Forms.PictureBox();
			this.tabText = new System.Windows.Forms.TabPage();
			this.btPaste = new System.Windows.Forms.Button();
			this.lbModified = new System.Windows.Forms.Label();
			this.btAddFile = new System.Windows.Forms.Button();
			this.btDelChap = new System.Windows.Forms.Button();
			this.btRenChap = new System.Windows.Forms.Button();
			this.btAddChap = new System.Windows.Forms.Button();
			this.tbText = new System.Windows.Forms.TextBox();
			this.tbCurrChapStr = new System.Windows.Forms.TextBox();
			this.lbChapters = new System.Windows.Forms.ListBox();
			this.tabImage = new System.Windows.Forms.TabPage();
			this.btJpgClear = new System.Windows.Forms.Button();
			this.btJpgAdd = new System.Windows.Forms.Button();
			this.btJpgDel = new System.Windows.Forms.Button();
			this.checkUserText = new System.Windows.Forms.CheckBox();
			this.tbMhText = new System.Windows.Forms.TextBox();
			this.lbJpgFile = new System.Windows.Forms.ListBox();
			this.btMhDelChap = new System.Windows.Forms.Button();
			this.btMhRenChap = new System.Windows.Forms.Button();
			this.btMhAddChap = new System.Windows.Forms.Button();
			this.tbMhCurrChapStr = new System.Windows.Forms.TextBox();
			this.lbMhChapters = new System.Windows.Forms.ListBox();
			this.checkUserChap = new System.Windows.Forms.CheckBox();
			this.button1 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.tabMake = new System.Windows.Forms.TabPage();
			this.btGO = new System.Windows.Forms.Button();
			this.pbar = new System.Windows.Forms.ProgressBar();
			this.lbCheckList = new System.Windows.Forms.ListBox();
			this.tabAbout = new System.Windows.Forms.TabPage();
			this.lbAbout = new System.Windows.Forms.Label();
			this.dlgOpenDir = new System.Windows.Forms.FolderBrowserDialog();
			this.dlgOpenFile = new System.Windows.Forms.OpenFileDialog();
			this.mBookMenu = new System.Windows.Forms.MainMenu();
			this.menuItem1 = new System.Windows.Forms.MenuItem();
			this.menuItem2 = new System.Windows.Forms.MenuItem();
			this.menuItem3 = new System.Windows.Forms.MenuItem();
			this.menuItemExit = new System.Windows.Forms.MenuItem();
			this.menuItem5 = new System.Windows.Forms.MenuItem();
			this.menuItem6 = new System.Windows.Forms.MenuItem();
			this.menuItem7 = new System.Windows.Forms.MenuItem();
			this.menuItemAbout = new System.Windows.Forms.MenuItem();
			this.tabs.SuspendLayout();
			this.tabInfo.SuspendLayout();
			this.tabCover.SuspendLayout();
			this.tabText.SuspendLayout();
			this.tabImage.SuspendLayout();
			this.tabMake.SuspendLayout();
			this.tabAbout.SuspendLayout();
			this.SuspendLayout();
			// 
			// tabs
			// 
			this.tabs.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
			this.tabs.Controls.Add(this.tabInfo);
			this.tabs.Controls.Add(this.tabCover);
			this.tabs.Controls.Add(this.tabText);
			this.tabs.Controls.Add(this.tabImage);
			this.tabs.Controls.Add(this.tabMake);
			this.tabs.Controls.Add(this.tabAbout);
			this.tabs.Location = new System.Drawing.Point(0, 0);
			this.tabs.Name = "tabs";
			this.tabs.SelectedIndex = 0;
			this.tabs.Size = new System.Drawing.Size(472, 248);
			this.tabs.TabIndex = 0;
			this.tabs.SelectedIndexChanged += new System.EventHandler(this.tabs_SelectedIndexChanged);
			// 
			// tabInfo
			// 
			this.tabInfo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tabInfo.Controls.Add(this.cbType);
			this.tabInfo.Controls.Add(this.label7);
			this.tabInfo.Controls.Add(this.btOpenDir);
			this.tabInfo.Controls.Add(this.cbGender);
			this.tabInfo.Controls.Add(this.dtpDate);
			this.tabInfo.Controls.Add(this.tbSaveTo);
			this.tabInfo.Controls.Add(this.tbPublisher);
			this.tabInfo.Controls.Add(this.tbAuthor);
			this.tabInfo.Controls.Add(this.tbTitle);
			this.tabInfo.Controls.Add(this.lbInfo);
			this.tabInfo.Controls.Add(this.label6);
			this.tabInfo.Controls.Add(this.label5);
			this.tabInfo.Controls.Add(this.label4);
			this.tabInfo.Controls.Add(this.label3);
			this.tabInfo.Controls.Add(this.label2);
			this.tabInfo.Controls.Add(this.label1);
			this.tabInfo.Location = new System.Drawing.Point(4, 24);
			this.tabInfo.Name = "tabInfo";
			this.tabInfo.Size = new System.Drawing.Size(464, 220);
			this.tabInfo.TabIndex = 0;
			this.tabInfo.Text = "1-基本信息";
			// 
			// cbType
			// 
			this.cbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbType.Location = new System.Drawing.Point(344, 16);
			this.cbType.Name = "cbType";
			this.cbType.Size = new System.Drawing.Size(112, 20);
			this.cbType.TabIndex = 9;
			this.cbType.SelectedIndexChanged += new System.EventHandler(this.cbType_SelectedIndexChanged);
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(240, 16);
			this.label7.Name = "label7";
			this.label7.TabIndex = 1;
			this.label7.Text = "类型:";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// btOpenDir
			// 
			this.btOpenDir.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btOpenDir.Location = new System.Drawing.Point(240, 176);
			this.btOpenDir.Name = "btOpenDir";
			this.btOpenDir.Size = new System.Drawing.Size(75, 24);
			this.btOpenDir.TabIndex = 15;
			this.btOpenDir.Text = "浏览";
			this.btOpenDir.Click += new System.EventHandler(this.btOpenDir_Click);
			// 
			// cbGender
			// 
			this.cbGender.Location = new System.Drawing.Point(120, 112);
			this.cbGender.Name = "cbGender";
			this.cbGender.Size = new System.Drawing.Size(112, 20);
			this.cbGender.TabIndex = 12;
			this.cbGender.Text = "现在文学";
			// 
			// dtpDate
			// 
			this.dtpDate.Location = new System.Drawing.Point(120, 80);
			this.dtpDate.Name = "dtpDate";
			this.dtpDate.Size = new System.Drawing.Size(112, 21);
			this.dtpDate.TabIndex = 11;
			// 
			// tbSaveTo
			// 
			this.tbSaveTo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tbSaveTo.Location = new System.Drawing.Point(120, 176);
			this.tbSaveTo.Name = "tbSaveTo";
			this.tbSaveTo.Size = new System.Drawing.Size(112, 21);
			this.tbSaveTo.TabIndex = 14;
			this.tbSaveTo.Text = "";
			// 
			// tbPublisher
			// 
			this.tbPublisher.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tbPublisher.Location = new System.Drawing.Point(120, 144);
			this.tbPublisher.MaxLength = 50;
			this.tbPublisher.Name = "tbPublisher";
			this.tbPublisher.Size = new System.Drawing.Size(112, 21);
			this.tbPublisher.TabIndex = 13;
			this.tbPublisher.Text = "(无)";
			this.tbPublisher.Enter += new System.EventHandler(this.TB_FocusOn);
			// 
			// tbAuthor
			// 
			this.tbAuthor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tbAuthor.Location = new System.Drawing.Point(120, 48);
			this.tbAuthor.MaxLength = 50;
			this.tbAuthor.Name = "tbAuthor";
			this.tbAuthor.Size = new System.Drawing.Size(112, 21);
			this.tbAuthor.TabIndex = 10;
			this.tbAuthor.Text = "(无名氏)";
			this.tbAuthor.Enter += new System.EventHandler(this.TB_FocusOn);
			// 
			// tbTitle
			// 
			this.tbTitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tbTitle.Location = new System.Drawing.Point(120, 16);
			this.tbTitle.MaxLength = 50;
			this.tbTitle.Name = "tbTitle";
			this.tbTitle.Size = new System.Drawing.Size(112, 21);
			this.tbTitle.TabIndex = 8;
			this.tbTitle.Text = "(未命名)";
			this.tbTitle.Enter += new System.EventHandler(this.TB_FocusOn);
			// 
			// lbInfo
			// 
			this.lbInfo.Location = new System.Drawing.Point(240, 96);
			this.lbInfo.Name = "lbInfo";
			this.lbInfo.Size = new System.Drawing.Size(192, 72);
			this.lbInfo.TabIndex = 7;
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(16, 176);
			this.label6.Name = "label6";
			this.label6.TabIndex = 6;
			this.label6.Text = "保存至:";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -