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

📄 mbookmaker.cs

📁 用VC.NET开发的应用于Symbian上的电子书开发源代码.
💻 CS
📖 第 1 页 / 共 5 页
字号:
			this.btMhDelChap.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btMhDelChap.Location = new System.Drawing.Point(120, 192);
			this.btMhDelChap.Name = "btMhDelChap";
			this.btMhDelChap.Size = new System.Drawing.Size(48, 24);
			this.btMhDelChap.TabIndex = 9;
			this.btMhDelChap.Text = "删除";
			this.btMhDelChap.Click += new System.EventHandler(this.btMhDelChap_Click);
			// 
			// btMhRenChap
			// 
			this.btMhRenChap.Enabled = false;
			this.btMhRenChap.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btMhRenChap.Location = new System.Drawing.Point(64, 192);
			this.btMhRenChap.Name = "btMhRenChap";
			this.btMhRenChap.Size = new System.Drawing.Size(48, 24);
			this.btMhRenChap.TabIndex = 8;
			this.btMhRenChap.Text = "改名";
			this.btMhRenChap.Click += new System.EventHandler(this.btMhRenChap_Click);
			// 
			// btMhAddChap
			// 
			this.btMhAddChap.Enabled = false;
			this.btMhAddChap.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btMhAddChap.Location = new System.Drawing.Point(8, 192);
			this.btMhAddChap.Name = "btMhAddChap";
			this.btMhAddChap.Size = new System.Drawing.Size(48, 24);
			this.btMhAddChap.TabIndex = 7;
			this.btMhAddChap.Text = "添加";
			this.btMhAddChap.Click += new System.EventHandler(this.btMhAddChap_Click);
			// 
			// tbMhCurrChapStr
			// 
			this.tbMhCurrChapStr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tbMhCurrChapStr.Enabled = false;
			this.tbMhCurrChapStr.Location = new System.Drawing.Point(8, 168);
			this.tbMhCurrChapStr.MaxLength = 255;
			this.tbMhCurrChapStr.Name = "tbMhCurrChapStr";
			this.tbMhCurrChapStr.Size = new System.Drawing.Size(176, 21);
			this.tbMhCurrChapStr.TabIndex = 6;
			this.tbMhCurrChapStr.Text = "";
			// 
			// lbMhChapters
			// 
			this.lbMhChapters.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.lbMhChapters.Enabled = false;
			this.lbMhChapters.ItemHeight = 12;
			this.lbMhChapters.Location = new System.Drawing.Point(8, 32);
			this.lbMhChapters.Name = "lbMhChapters";
			this.lbMhChapters.Size = new System.Drawing.Size(176, 134);
			this.lbMhChapters.TabIndex = 5;
			this.lbMhChapters.SelectedIndexChanged += new System.EventHandler(this.lbMhChapters_SelectedIndexChanged);
			// 
			// checkUserChap
			// 
			this.checkUserChap.Location = new System.Drawing.Point(8, 8);
			this.checkUserChap.Name = "checkUserChap";
			this.checkUserChap.Size = new System.Drawing.Size(88, 24);
			this.checkUserChap.TabIndex = 0;
			this.checkUserChap.Text = "使用目录↓";
			this.checkUserChap.CheckedChanged += new System.EventHandler(this.checkUserChap_CheckedChanged);
			// 
			// button1
			// 
			this.button1.Enabled = false;
			this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.button1.Location = new System.Drawing.Point(120, 192);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(48, 24);
			this.button1.TabIndex = 9;
			this.button1.Text = "删除";
			// 
			// button2
			// 
			this.button2.Enabled = false;
			this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.button2.Location = new System.Drawing.Point(8, 192);
			this.button2.Name = "button2";
			this.button2.Size = new System.Drawing.Size(48, 24);
			this.button2.TabIndex = 7;
			this.button2.Text = "添加";
			// 
			// tabMake
			// 
			this.tabMake.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tabMake.Controls.Add(this.btGO);
			this.tabMake.Controls.Add(this.pbar);
			this.tabMake.Controls.Add(this.lbCheckList);
			this.tabMake.Location = new System.Drawing.Point(4, 24);
			this.tabMake.Name = "tabMake";
			this.tabMake.Size = new System.Drawing.Size(464, 220);
			this.tabMake.TabIndex = 3;
			this.tabMake.Text = "4-确认制作";
			// 
			// btGO
			// 
			this.btGO.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btGO.Location = new System.Drawing.Point(184, 184);
			this.btGO.Name = "btGO";
			this.btGO.Size = new System.Drawing.Size(72, 24);
			this.btGO.TabIndex = 2;
			this.btGO.Text = "开始制作";
			this.btGO.Click += new System.EventHandler(this.btGO_Click);
			// 
			// pbar
			// 
			this.pbar.Location = new System.Drawing.Point(8, 152);
			this.pbar.Name = "pbar";
			this.pbar.Size = new System.Drawing.Size(448, 23);
			this.pbar.TabIndex = 1;
			// 
			// lbCheckList
			// 
			this.lbCheckList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.lbCheckList.ItemHeight = 12;
			this.lbCheckList.Location = new System.Drawing.Point(8, 8);
			this.lbCheckList.Name = "lbCheckList";
			this.lbCheckList.Size = new System.Drawing.Size(448, 146);
			this.lbCheckList.TabIndex = 0;
			// 
			// tabAbout
			// 
			this.tabAbout.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.tabAbout.Controls.Add(this.lbAbout);
			this.tabAbout.Location = new System.Drawing.Point(4, 24);
			this.tabAbout.Name = "tabAbout";
			this.tabAbout.Size = new System.Drawing.Size(464, 220);
			this.tabAbout.TabIndex = 4;
			this.tabAbout.Text = "关于";
			// 
			// lbAbout
			// 
			this.lbAbout.Location = new System.Drawing.Point(8, 8);
			this.lbAbout.Name = "lbAbout";
			this.lbAbout.Size = new System.Drawing.Size(448, 208);
			this.lbAbout.TabIndex = 0;
			this.lbAbout.Text = "label7";
			this.lbAbout.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// mBookMenu
			// 
			this.mBookMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.menuItem1,
																					  this.menuItem5,
																					  this.menuItem7});
			// 
			// menuItem1
			// 
			this.menuItem1.Index = 0;
			this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.menuItem2,
																					  this.menuItem3,
																					  this.menuItemExit});
			this.menuItem1.Text = "文件(&F)";
			// 
			// menuItem2
			// 
			this.menuItem2.Index = 0;
			this.menuItem2.Text = "打开(&O)";
			// 
			// menuItem3
			// 
			this.menuItem3.Index = 1;
			this.menuItem3.Text = "保存(&S)";
			// 
			// menuItemExit
			// 
			this.menuItemExit.Index = 2;
			this.menuItemExit.Text = "退出(&E)";
			this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
			// 
			// menuItem5
			// 
			this.menuItem5.Index = 1;
			this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.menuItem6});
			this.menuItem5.Text = "反编译(&U)";
			// 
			// menuItem6
			// 
			this.menuItem6.Index = 0;
			this.menuItem6.Text = "打开(&O)";
			// 
			// menuItem7
			// 
			this.menuItem7.Index = 2;
			this.menuItem7.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					  this.menuItemAbout});
			this.menuItem7.Text = "帮助(&H)";
			// 
			// menuItemAbout
			// 
			this.menuItemAbout.Index = 0;
			this.menuItemAbout.Text = "关于(&A)";
			this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click);
			// 
			// mBookMaker
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(472, 245);
			this.Controls.Add(this.tabs);
			this.Menu = this.mBookMenu;
			this.Name = "mBookMaker";
			this.Text = "mBook制作工具";
			this.Closed += new System.EventHandler(this.mBookMaker_Closed);
			this.tabs.ResumeLayout(false);
			this.tabInfo.ResumeLayout(false);
			this.tabCover.ResumeLayout(false);
			this.tabText.ResumeLayout(false);
			this.tabImage.ResumeLayout(false);
			this.tabMake.ResumeLayout(false);
			this.tabAbout.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new mBookMaker());
		}

		private void TB_FocusOn(object sender, System.EventArgs e)
		{
			if (this.tbTitle.Focused)
			{
				this.tbTitle.SelectAll();
				if (this.tbTitle.SelectedText == "(未命名)")
				{
					this.tbTitle.Clear();
				}
			}
			if (this.tbAuthor.Focused)
			{
				this.tbAuthor.SelectAll();
				if (this.tbAuthor.SelectedText == "(无名氏)")
				{
					this.tbAuthor.Clear();
				}
			}
			if (this.tbPublisher.Focused)
			{
				this.tbPublisher.SelectAll();
				if (this.tbPublisher.SelectedText == "(无)")
				{
					this.tbPublisher.Clear();
				}
			}
		}

		private void btOpenDir_Click(object sender, System.EventArgs e)
		{
			if (this.dlgOpenDir.ShowDialog() == DialogResult.OK)
			{
				this.tbSaveTo.Text = this.dlgOpenDir.SelectedPath;
			}
		}

		private void tabs_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			this.iTotalen = 0;
			this.iChapStr.Clear();
			if (this.tabs.TabPages[this.tabs.SelectedIndex].Text != "1-基本信息")
			{
				if (this.tbTitle.Text.Length <= 0)
				{
					this.tabs.SelectedIndex = 0;
					MessageBox.Show("请填写书名!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}
				if (this.tbAuthor.Text.Length <= 0)
				{
					this.tabs.SelectedIndex = 0;
					MessageBox.Show("请填写作者!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				}
			}
			if (this.tabs.TabPages[this.tabs.SelectedIndex].Text == "2-封面图片")
			{
				if (File.Exists(this.iCoverFile + ".tmp"))
				{
					File.Delete(this.iCoverFile + ".tmp");
				}
				if (this.iCoverFile == (Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Remove(0, 8)) + @"\cover.jpg"))
				{
					SizeF ef1;
					string[] textArray1;
					this.myCover = Image.FromFile(this.iCoverFile);
					Graphics graphics1 = Graphics.FromImage(this.myCover);
					ArrayList list1 = new ArrayList();
					Font font1 = new Font("宋体", 16f);
					string text1 = "";
					for (int num1 = 0; num1 < this.tbTitle.Text.Length; num1++)
					{
						text1 = text1 + this.tbTitle.Text.Substring(num1, 1);
						ef1 = graphics1.MeasureString(text1, font1);
						if (((int) ef1.Width) > 150)
						{
							list1.Add(text1.Substring(0, text1.Length - 1));
							text1 = this.tbTitle.Text.Substring(num1, 1);
						}
					}
					list1.Add(text1);
					for (int num2 = 0; num2 < list1.Count; num2++)
					{
						ef1 = graphics1.MeasureString((string) list1[num2], font1);
						graphics1.DrawString((string) list1[num2], font1, Brushes.White, (float) ((176f - ef1.Width) / 2f), (float) (30 + ((font1.Height + 3) * num2)));
					}
					graphics1.ReleaseHdc(graphics1.GetHdc());
					this.pbPreview.Image = Image.FromFile(this.iCoverFile);
					Graphics graphics2 = Graphics.FromImage(this.pbPreview.Image);
					for (int num3 = 0; num3 < list1.Count; num3++)
					{
						ef1 = graphics2.MeasureString((string) list1[num3], font1);
						graphics2.DrawString((string) list1[num3], font1, Brushes.White, (float) ((176f - ef1.Width) / 2f), (float) (30 + ((font1.Height + 3) * num3)));
					}
					graphics2.ReleaseHdc(graphics2.GetHdc());
					this.myCover.Save(this.iCoverFile + ".tmp", ImageFormat.Jpeg);
					if (this.tbSaveTo.Text.EndsWith(@"\"))
					{
						textArray1 = new string[5] { "您的缺省封面保存在:\n", Path.GetDirectoryName(this.tbSaveTo.Text), @"\", this.tbTitle.Text, ".jpg" } ;
						this.lbDefCover.Text = string.Concat(textArray1);
					}
					else
					{
						textArray1 = new string[5] { "您的缺省封面保存在:\n", this.tbSaveTo.Text, @"\", this.tbTitle.Text, ".jpg" } ;
						this.lbDefCover.Text = string.Concat(textArray1);
					}
				}
				else if (!File.Exists(this.iCoverFile + ".tmp"))
				{
					File.Copy(this.iCoverFile, this.iCoverFile + ".tmp", true);
				}
			}
			//**********************
			if ((iType == 0) & (tabs.SelectedTab == tabText))//普通书
			{
				tabs.SelectedTab = tabText;

⌨️ 快捷键说明

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