Commit f96a1338 authored by JoyJ's avatar JoyJ

able to change tooltip font; able to scroll down when at text bottom when edit code

parent 79e724fb
This diff is collapsed.
......@@ -17,6 +17,7 @@
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.Script.Serialization;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
......@@ -420,8 +421,7 @@ void HideMenu()
void CodeEditFormLoad(object sender, EventArgs e)
{
this.HideMenu();
this.fctb.OnTextChangedDelayed(this.fctb.Range);
}
void Menuitem_findClick(object sender, EventArgs e)
{
......@@ -680,5 +680,23 @@ private void OnDragDtop(object sender, DragEventArgs e)
(this.DockPanel.Parent as MainForm).Open(file);
}
}
private void menuitem_tooltipFont_Click(object sender, EventArgs e)
{
FontDialog fd = new FontDialog();
string fontJson = MyConfig.ReadString(MyConfig.TOOLTIP_FONT);
Font f = new Font("微软雅黑",10);
JavaScriptSerializer jss = new JavaScriptSerializer();
try
{
f = jss.Deserialize<Font>(fontJson);
}
catch { }
fd.Font = f;
if (fd.ShowDialog() == DialogResult.OK)
{
Common.XMLReader.Save(MyConfig.TOOLTIP_FONT, jss.Serialize(fd.Font));
this.fctb.lbTooltip.Font = fd.Font;
}
}
}
}
......@@ -172,6 +172,10 @@ public class MyConfig : XMLReader
/// 连接标志
/// </summary>
public const string TAG_MARKER = "link marker";
/// <summary>
/// 临时文件
/// </summary>
public const string TOOLTIP_FONT = "tooltip_font";
#endregion
#region 读取内容
......
......@@ -7,6 +7,7 @@
*/
using System;
using System.Drawing;
using System.Web.Script.Serialization;
using System.Windows.Forms;
namespace FastColoredTextBoxNS
......@@ -14,6 +15,7 @@ namespace FastColoredTextBoxNS
public class FastColoredTextBoxEx : FastColoredTextBox
{
public Label lbTooltip;
private Label lbSizeController;
Point lastMouseCoord;
public FastColoredTextBoxEx() : base()
{
......@@ -25,12 +27,6 @@ public FastColoredTextBoxEx() : base()
this.Selection.ColumnSelectionMode = true;
this.InitializeComponent();
}
public override void OnTextChanged()
{
}
public new event EventHandler<ToolTipNeededEventArgs> ToolTipNeeded;
protected override void OnMouseMove(MouseEventArgs e)
{
......@@ -124,31 +120,46 @@ void FctbTextChanged(object sender, TextChangedEventArgs e)
private void InitializeComponent()
{
this.lbTooltip = new Label();
this.lbTooltip = new System.Windows.Forms.Label();
this.lbSizeController = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
this.SuspendLayout();
//
// lbTooltip
//
this.lbTooltip.AutoSize = true;
this.lbTooltip.BackColor = SystemColors.Desktop;
this.lbTooltip.Font = new Font("微软雅黑", 15.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
this.lbTooltip.ForeColor = SystemColors.Control;
this.lbTooltip.Location = new Point(221, 117);
this.lbTooltip.MaximumSize = new Size(480, 0);
this.lbTooltip.BackColor = System.Drawing.SystemColors.Desktop;
this.lbTooltip.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbTooltip.ForeColor = System.Drawing.SystemColors.Control;
this.lbTooltip.Location = new System.Drawing.Point(221, 117);
this.lbTooltip.MaximumSize = new System.Drawing.Size(480, 0);
this.lbTooltip.Name = "lbTooltip";
this.lbTooltip.Size = new Size(0, 28);
this.lbTooltip.Size = new System.Drawing.Size(0, 28);
this.lbTooltip.TabIndex = 1;
this.lbTooltip.MouseMove += new MouseEventHandler(this.lbTooltip_MouseMove);
this.lbTooltip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lbTooltip_MouseMove);
//
// lbSizeController
//
this.lbSizeController.AutoSize = true;
this.lbSizeController.BackColor = System.Drawing.Color.Transparent;
this.lbSizeController.ForeColor = System.Drawing.Color.Transparent;
this.lbSizeController.Location = new System.Drawing.Point(179, 293);
this.lbSizeController.Name = "lbSizeController";
this.lbSizeController.Size = new System.Drawing.Size(136, 16);
this.lbSizeController.TabIndex = 2;
this.lbSizeController.Text = "lbSizeController";
//
// FastColoredTextBoxEx
//
this.AutoScrollMinSize = new Size(27, 14);
this.BackColor = SystemColors.Control;
this.AutoScrollMinSize = new System.Drawing.Size(27, 14);
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.lbSizeController);
this.Controls.Add(this.lbTooltip);
this.Name = "FastColoredTextBoxEx";
this.Size = new Size(584, 327);
this.Load += new EventHandler(this.FastColoredTextBoxEx_Load);
this.Size = new System.Drawing.Size(584, 327);
this.Load += new System.EventHandler(this.FastColoredTextBoxEx_Load);
this.Scroll += new System.Windows.Forms.ScrollEventHandler(this.FastColoredTextBoxEx_Scroll);
this.SizeChanged += new System.EventHandler(this.FastColoredTextBoxEx_SizeChanged);
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -164,5 +175,20 @@ private void lbTooltip_MouseMove(object sender, MouseEventArgs e)
{
this.lbTooltip.Visible = false;
}
private void ResizeWindow()
{
lbSizeController.Location = new Point(0, this.Height);
lbSizeController.Text = "\r\n\r\n";
}
private void FastColoredTextBoxEx_SizeChanged(object sender, EventArgs e)
{
lbTooltip.Visible = false;
this.ResizeWindow();
}
private void FastColoredTextBoxEx_Scroll(object sender, ScrollEventArgs e)
{
this.ResizeWindow();
}
}
}
......@@ -75,7 +75,7 @@
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.113.1\lib\net46\System.Data.SQLite.dll</HintPath>
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.1\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.EF6, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.113.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
......@@ -84,6 +84,7 @@
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.113.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
......@@ -313,10 +314,10 @@
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.113.1\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.113.1\build\net46\System.Data.SQLite.Core.targets'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
<Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.1\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.1\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
</Target>
<Import Project="..\packages\System.Data.SQLite.Core.1.0.113.1\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.113.1\build\net46\System.Data.SQLite.Core.targets')" />
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
<Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.1\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.113.1\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
</Project>
\ No newline at end of file
This diff is collapsed.
......@@ -32,6 +32,8 @@
<add key="opera_with_cards_file" value="true"/>
<!-- open file in this.such as lua -->
<add key="open_file_in_this" value="true"/>
<!-- open file in this.such as lua -->
<add key="tooltip_font" value=""/>
<!-- check update when opening application automatically -->
<add key="auto_check_update" value="true"/>
<!-- add require automatically -->
......
......@@ -5,6 +5,7 @@ CodeEditForm.mainMenu.menuitem_save 保存
CodeEditForm.mainMenu.menuitem_saveas 另存为
CodeEditForm.mainMenu.menuitem_quit 退出
CodeEditForm.mainMenu.menuitem_setting 选项(&S)
CodeEditForm.mainMenu.menuitem_tooltipFont 设置函数提示字体
CodeEditForm.mainMenu.menuitem_showmap 显示/隐藏结构图
CodeEditForm.mainMenu.menuitem_showinput 显示/隐藏输入框
CodeEditForm.mainMenu.menuitem_find 查找
......
......@@ -7,8 +7,9 @@
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net46" />
<package id="NeoLua" version="1.3.11" targetFramework="net46" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.113.1" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.113.1" targetFramework="net46" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.113.1" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.113.3" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.113.3" targetFramework="net46" />
<package id="System.Data.SQLite.EF6" version="1.0.113.0" targetFramework="net46" />
<package id="System.Data.SQLite.Linq" version="1.0.113.0" targetFramework="net46" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment