### 2021-10-16更新

------
#### TimeClock    V1.0.2110.1601
- *.[新增]便笺新增靠边隐藏功能。
This commit is contained in:
鑫Intel 2021-10-16 16:21:09 +08:00
parent c354d01b08
commit 094d1f9d50
23 changed files with 1034 additions and 644 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,2 +1,2 @@
[TimeClock] [TimeClock]
hwnd=5705712 hwnd=143234

View File

@ -1,3 +1,3 @@
<root> <root>
<list id="LastUpdateTime" Value="2020/12/17 14:43:55" /> <list id="LastUpdateTime" Value="2021/10/16 16:17:23" />
</root> </root>

View File

@ -1,4 +1,9 @@
### 2021-08-15更新 ### 2021-10-16更新
------
#### TimeClock V1.0.2110.1601
- *.[新增]便笺新增靠边隐藏功能。
### 2021-08-15更新
------ ------
#### RyLine V2.0.2108.1501 #### RyLine V2.0.2108.1501
- *.[改进]时间同步方式采用NTP方式进行同步。 - *.[改进]时间同步方式采用NTP方式进行同步。

Binary file not shown.

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MyTimeClock
{
class Init
{
static System.Threading.Mutex run;
public static void Run(string[] args)
{
Itrycn_Info.UserDataFolder = ryCommon.RyFiles.GetRealPath(Itrycn_Info.UserDataFolder);
run = new System.Threading.Mutex(true, Itrycn_Info.Soft_Id, out bool runone);
if (!runone) //已经运行了
{
ryCommon.Ini ini = new ryCommon.Ini(Itrycn_Info.UserDataFolder + "\\Win.dat");
ryControls.Win32.SendMessage((IntPtr)ini.ReadIni(Itrycn_Info.Soft_Id, "hwnd", 0), 17189, 100, 100);
}
else
{
Application.Run(new Frmmain(args));
}
}
}
}

View File

@ -68,6 +68,7 @@
<Compile Include="Frmmain.Designer.cs"> <Compile Include="Frmmain.Designer.cs">
<DependentUpon>Frmmain.cs</DependentUpon> <DependentUpon>Frmmain.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Init.cs" />
<Compile Include="Itrycn_Info.cs" /> <Compile Include="Itrycn_Info.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -1,33 +1,44 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Windows.Forms; using System.Windows.Forms;
namespace MyTimeClock namespace MyTimeClock
{ {
static class Program static class Program
{ {
static System.Threading.Mutex run;
/// <summary> /// <summary>
/// 应用程序的主入口点。 /// 应用程序的主入口点。
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main(string[] args) static void Main(string[] args)
{ {
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
Application.ThreadException += Application_ThreadException; Application.ThreadException += Application_ThreadException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Itrycn_Info.UserDataFolder = ryCommon.RyFiles.GetRealPath(Itrycn_Info.UserDataFolder); Init.Run(args);
run = new System.Threading.Mutex(true, Itrycn_Info.Soft_Id, out bool runone); }
if (!runone) //已经运行了 static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
try
{ {
ryCommon.Ini ini = new ryCommon.Ini(Itrycn_Info.UserDataFolder + "\\Win.dat"); AssemblyName assemblyName = new AssemblyName(args.Name);
ryControls.Win32.SendMessage((IntPtr)ini.ReadIni(Itrycn_Info.Soft_Id, "hwnd", 0), 17189, 100, 100); if (System.IO.File.Exists(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll"))
{
return Assembly.LoadFrom(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll");
}
else
{
return args.RequestingAssembly;
}
} }
else catch (Exception ex)
{ {
Application.Run(new Frmmain(args)); return args.RequestingAssembly;
} }
} }
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RyLine
{
public class Init
{
public static void Run(string[] args)
{
if (args.Length == 1)
{
RyCode.RunCodeLine(args[0]);
}
else if (args.Length > 1)
{
if (args[0] == "SetAutoRun" && args.Length == 4)
{ ryCommon.ryStart.SetAutoRun(true, args[1], "\"" + args[2] + "\"" + " " + args[3]); }
else if (args[0] == "DelAutoRun" && args.Length == 2)
{ ryCommon.ryStart.SetAutoRun(false, args[1]); }
else if (args[0] == "Hosts" && args.Length == 2)
{
if (System.IO.File.Exists(args[1]))
{
ryCommon.Hosts.AddHosts(ryCommon.RyFiles.ReadAllText(args[1]));
}
}
}
}
}
}

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Reflection;
using System.Windows.Forms; using System.Windows.Forms;
namespace RyLine namespace RyLine
@ -11,31 +12,34 @@ namespace RyLine
[STAThread] [STAThread]
static void Main(string[] args) static void Main(string[] args)
{ {
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
// 修改 EWX_SHUTDOWN 或者 EWX_LOGOFF, EWX_REBOOT等实现不同得功能。 // 修改 EWX_SHUTDOWN 或者 EWX_LOGOFF, EWX_REBOOT等实现不同得功能。
// 在XP下可以看到帮助信息以得到不同得参数 // 在XP下可以看到帮助信息以得到不同得参数
// SHUTDOWN /? // SHUTDOWN /?
if(args.Length==1) Init.Run(args);
{
RyCode.RunCodeLine(args[0]);
}
else if (args.Length>1)
{
if(args[0]=="SetAutoRun" && args.Length == 4)
{ ryCommon.ryStart.SetAutoRun(true, args[1], "\""+args[2]+ "\"" + " "+args[3]); }
else if (args[0] == "DelAutoRun" && args.Length == 2)
{ ryCommon.ryStart.SetAutoRun(false, args[1]); }
else if (args[0] == "Hosts" && args.Length == 2)
{
if (System.IO.File.Exists(args[1]))
{
ryCommon.Hosts.AddHosts(ryCommon.RyFiles.ReadAllText(args[1]));
}
}
}
//shoutdown.DoExitWin(shoutdown.EWX_SHUTDOWN + shoutdown.EWX_FORCE); //shoutdown.DoExitWin(shoutdown.EWX_SHUTDOWN + shoutdown.EWX_FORCE);
//Application.Run(new Form1()); //Application.Run(new Form1());
} }
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
try
{
AssemblyName assemblyName = new AssemblyName(args.Name);
if (System.IO.File.Exists(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll"))
{
return Assembly.LoadFrom(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll");
}
else
{
return args.RequestingAssembly;
}
}
catch (Exception ex)
{
return args.RequestingAssembly;
}
}
} }
} }

View File

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RyLine")] [assembly: AssemblyProduct("RyLine")]
[assembly: AssemblyCopyright("Copyright © 2017-2019")] [assembly: AssemblyCopyright("Copyright © 2017-2021")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.2108.1501")] [assembly: AssemblyVersion("2.0.2108.2601")]
[assembly: AssemblyFileVersion("2.0.2108.1501")] [assembly: AssemblyFileVersion("2.0.2108.2601")]

View File

@ -62,6 +62,7 @@
<Compile Include="FrmConfirm.Designer.cs"> <Compile Include="FrmConfirm.Designer.cs">
<DependentUpon>FrmConfirm.cs</DependentUpon> <DependentUpon>FrmConfirm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Init.cs" />
<Compile Include="NTPClient.cs" /> <Compile Include="NTPClient.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -0,0 +1,259 @@
using System;
using System.Drawing;
using System.Collections.Generic;
using System.Windows.Forms;
namespace TimeClock.API
{
public enum MagneticLocation
{
Left = 0,
Right = 1,
Top = 2,
Bottom = 3
}
public enum MagneticState
{
Adsorbent, // 吸附
Separation // 分离
}
public class MagneticManager
{
public class ChildFormInfo
{
public Form Child { get; set; }
public MagneticLocation Location { get; set; }
public MagneticState State { get; set; }
public bool CutstomSetLocation { get; set; }
}
public int Step { get; set; }
private Form m_mainForm = null;
private List<ChildFormInfo> m_childs = new List<ChildFormInfo>();
public MagneticManager(Form form)
{
m_mainForm = form;
form.LocationChanged += MainForm_LocationChanged;
form.SizeChanged += MainForm_SizeChanged;
form.FormClosed += MainForm_FormClosed;
Step = 20;
}
public void addChild(Form childForm, MagneticLocation loc)
{
foreach (ChildFormInfo info in m_childs)
{
if (info.Child == childForm)
{
return;
}
}
ChildFormInfo childInfo = new ChildFormInfo();
childInfo.Child = childForm;
childInfo.Location = loc;
childInfo.State = MagneticState.Adsorbent;
childInfo.CutstomSetLocation = false;
childForm.LocationChanged += ChildForm_LocationChanged;
childForm.SizeChanged += ChildForm_SizeChanged;
childForm.FormClosed += ChildForm_FormClosed;
m_childs.Add(childInfo);
adsorbentChild(childInfo);
}
private ChildFormInfo getInfo(Form form)
{
if (form == null)
{
return null;
}
foreach (ChildFormInfo info in m_childs)
{
if (info.Child == form)
{
return info;
}
}
return null;
}
private Point getLocation(ChildFormInfo info)
{
Point pos = Point.Empty;
switch (info.Location)
{
case MagneticLocation.Left:
pos = new Point(m_mainForm.Left - info.Child.Width + 14, m_mainForm.Top);
break;
case MagneticLocation.Right:
pos = new Point(m_mainForm.Right - 14, m_mainForm.Top);
break;
case MagneticLocation.Top:
pos = new Point(m_mainForm.Left, m_mainForm.Top - info.Child.Height);
break;
case MagneticLocation.Bottom:
pos = new Point(m_mainForm.Left, m_mainForm.Bottom);
break;
default:
break;
}
return pos;
}
private void setChildLocation(ChildFormInfo info, Point location)
{
if (info.Child == null)
{
return;
}
info.CutstomSetLocation = true;
info.Child.Location = location;
info.CutstomSetLocation = false;
}
private void setChildLocation(ChildFormInfo info, int x, int y)
{
setChildLocation(info, new Point(x, y));
}
private void resetChildLocation(ChildFormInfo info)
{
if (info.Child == null)
{
return;
}
Point pos = getLocation(info);
setChildLocation(info, pos);
}
private void adsorbentChild(ChildFormInfo info)
{
info.State = MagneticState.Adsorbent;
resetChildLocation(info);
}
private void separationChild(ChildFormInfo info)
{
info.State = MagneticState.Separation;
}
private void MainForm_LocationChanged(object sender, EventArgs e)
{
foreach (ChildFormInfo info in m_childs)
{
if (info.State == MagneticState.Adsorbent)
{
resetChildLocation(info);
}
}
}
private void MainForm_SizeChanged(object sender, EventArgs e)
{
foreach (ChildFormInfo info in m_childs)
{
if (info.State == MagneticState.Adsorbent)
{
resetChildLocation(info);
}
}
}
private void MainForm_FormClosed(object sender, EventArgs e)
{
}
private void ChildForm_LocationChanged(object sender, EventArgs e)
{
ChildFormInfo info = getInfo(sender as Form);
if (info == null)
{
return;
}
if (info.CutstomSetLocation == true)
{
return;
}
Point location = getLocation(info);
if (info.Child.Left > location.X && info.Location == MagneticLocation.Right)
{
if (info.Child.Left - location.X > Step)
{
separationChild(info);
}
else
{
adsorbentChild(info);
}
}
else if (info.Child.Left < location.X && info.Location == MagneticLocation.Left)
{
if (info.Child.Left - location.X < -Step)
{
separationChild(info);
}
else
{
adsorbentChild(info);
}
}
if (info.Child.Top > location.Y && info.Location == MagneticLocation.Bottom)
{
if (info.Child.Top - location.Y > Step)
{
separationChild(info);
}
else
{
adsorbentChild(info);
}
}
else if (info.Child.Top < location.Y && info.Location == MagneticLocation.Top)
{
if (info.Child.Top - location.Y < -Step)
{
separationChild(info);
}
else
{
adsorbentChild(info);
}
}
}
private void ChildForm_SizeChanged(object sender, EventArgs e)
{
ChildFormInfo info = getInfo(sender as Form);
if (info != null && info.State == MagneticState.Adsorbent)
{
resetChildLocation(info);
}
}
private void ChildForm_FormClosed(object sender, EventArgs e)
{
ChildFormInfo info = getInfo(sender as Form);
if (info != null)
{
m_childs.Remove(info);
}
}
}
}

View File

@ -62,6 +62,7 @@
this.LblClose = new System.Windows.Forms.Label(); this.LblClose = new System.Windows.Forms.Label();
this.LblAdd = new System.Windows.Forms.Label(); this.LblAdd = new System.Windows.Forms.Label();
this.PnlBottom = new System.Windows.Forms.Panel(); this.PnlBottom = new System.Windows.Forms.Panel();
this.LblImage = new System.Windows.Forms.Label();
this.LblBullet = new System.Windows.Forms.Label(); this.LblBullet = new System.Windows.Forms.Label();
this.LblStrikeout = new System.Windows.Forms.Label(); this.LblStrikeout = new System.Windows.Forms.Label();
this.LblUnderline = new System.Windows.Forms.Label(); this.LblUnderline = new System.Windows.Forms.Label();
@ -71,8 +72,8 @@
this.colorDialog1 = new System.Windows.Forms.ColorDialog(); this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.fontDialog1 = new System.Windows.Forms.FontDialog(); this.fontDialog1 = new System.Windows.Forms.FontDialog();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.LblImage = new System.Windows.Forms.Label();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MenuNote.SuspendLayout(); this.MenuNote.SuspendLayout();
this.PnlTop.SuspendLayout(); this.PnlTop.SuspendLayout();
this.PnlBottom.SuspendLayout(); this.PnlBottom.SuspendLayout();
@ -108,17 +109,18 @@
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem,
this.toolStripMenuItem4, this.toolStripMenuItem4,
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.MenuNote.Name = "MenuNote"; this.MenuNote.Name = "MenuNote";
this.MenuNote.Size = new System.Drawing.Size(149, 292); this.MenuNote.Size = new System.Drawing.Size(181, 336);
this.MenuNote.Opening += new System.ComponentModel.CancelEventHandler(this.MenuNote_Opening); this.MenuNote.Opening += new System.ComponentModel.CancelEventHandler(this.MenuNote_Opening);
// //
// 撤销ToolStripMenuItem // 撤销ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "撤销ToolStripMenuItem"; this.ToolStripMenuItem.Name = "撤销ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Z"; this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Z";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "撤销"; this.ToolStripMenuItem.Text = "撤销";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@ -126,20 +128,20 @@
// //
this.ToolStripMenuItem.Name = "重做ToolStripMenuItem"; this.ToolStripMenuItem.Name = "重做ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Y"; this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Y";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "重做"; this.ToolStripMenuItem.Text = "重做";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// toolStripMenuItem1 // toolStripMenuItem1
// //
this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(145, 6); this.toolStripMenuItem1.Size = new System.Drawing.Size(177, 6);
// //
// 剪切ToolStripMenuItem // 剪切ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "剪切ToolStripMenuItem"; this.ToolStripMenuItem.Name = "剪切ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+X"; this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+X";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "剪切"; this.ToolStripMenuItem.Text = "剪切";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@ -147,7 +149,7 @@
// //
this.ToolStripMenuItem.Name = "复制ToolStripMenuItem"; this.ToolStripMenuItem.Name = "复制ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C"; this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "复制"; this.ToolStripMenuItem.Text = "复制";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@ -155,7 +157,7 @@
// //
this.ToolStripMenuItem.Name = "粘贴ToolStripMenuItem"; this.ToolStripMenuItem.Name = "粘贴ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+V"; this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+V";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "粘贴"; this.ToolStripMenuItem.Text = "粘贴";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@ -163,46 +165,46 @@
// //
this.ToolStripMenuItem.Name = "删除ToolStripMenuItem"; this.ToolStripMenuItem.Name = "删除ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeyDisplayString = "Delete"; this.ToolStripMenuItem.ShortcutKeyDisplayString = "Delete";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "删除"; this.ToolStripMenuItem.Text = "删除";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// toolStripMenuItem2 // toolStripMenuItem2
// //
this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(145, 6); this.toolStripMenuItem2.Size = new System.Drawing.Size(177, 6);
// //
// 全选ToolStripMenuItem // 全选ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "全选ToolStripMenuItem"; this.ToolStripMenuItem.Name = "全选ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+A"; this.ToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "全选"; this.ToolStripMenuItem.Text = "全选";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// toolStripMenuItem3 // toolStripMenuItem3
// //
this.toolStripMenuItem3.Name = "toolStripMenuItem3"; this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(145, 6); this.toolStripMenuItem3.Size = new System.Drawing.Size(177, 6);
// //
// 字体ToolStripMenuItem // 字体ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "字体ToolStripMenuItem"; this.ToolStripMenuItem.Name = "字体ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "字体"; this.ToolStripMenuItem.Text = "字体";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 字体颜色ToolStripMenuItem // 字体颜色ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "字体颜色ToolStripMenuItem"; this.ToolStripMenuItem.Name = "字体颜色ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "字体颜色"; this.ToolStripMenuItem.Text = "字体颜色";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 背景颜色ToolStripMenuItem // 背景颜色ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "背景颜色ToolStripMenuItem"; this.ToolStripMenuItem.Name = "背景颜色ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "便笺背景颜色"; this.ToolStripMenuItem.Text = "便笺背景颜色";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@ -219,87 +221,87 @@
this.toolStripMenuItem12, this.toolStripMenuItem12,
this.toolStripMenuItem13}); this.toolStripMenuItem13});
this.ToolStripMenuItem.Name = "透明度ToolStripMenuItem"; this.ToolStripMenuItem.Name = "透明度ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "透明度"; this.ToolStripMenuItem.Text = "透明度";
// //
// 不透明ToolStripMenuItem // 不透明ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "不透明ToolStripMenuItem"; this.ToolStripMenuItem.Name = "不透明ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(112, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "不透明"; this.ToolStripMenuItem.Text = "不透明";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// toolStripMenuItem5 // toolStripMenuItem5
// //
this.toolStripMenuItem5.Name = "toolStripMenuItem5"; this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(109, 6); this.toolStripMenuItem5.Size = new System.Drawing.Size(177, 6);
// //
// toolStripMenuItem7 // toolStripMenuItem7
// //
this.toolStripMenuItem7.Name = "toolStripMenuItem7"; this.toolStripMenuItem7.Name = "toolStripMenuItem7";
this.toolStripMenuItem7.Size = new System.Drawing.Size(112, 22); this.toolStripMenuItem7.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem7.Text = "60%"; this.toolStripMenuItem7.Text = "60%";
this.toolStripMenuItem7.Click += new System.EventHandler(this.toolStripMenuItem7_Click); this.toolStripMenuItem7.Click += new System.EventHandler(this.toolStripMenuItem7_Click);
// //
// toolStripMenuItem8 // toolStripMenuItem8
// //
this.toolStripMenuItem8.Name = "toolStripMenuItem8"; this.toolStripMenuItem8.Name = "toolStripMenuItem8";
this.toolStripMenuItem8.Size = new System.Drawing.Size(112, 22); this.toolStripMenuItem8.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem8.Text = "70%"; this.toolStripMenuItem8.Text = "70%";
this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click); this.toolStripMenuItem8.Click += new System.EventHandler(this.toolStripMenuItem8_Click);
// //
// toolStripMenuItem9 // toolStripMenuItem9
// //
this.toolStripMenuItem9.Name = "toolStripMenuItem9"; this.toolStripMenuItem9.Name = "toolStripMenuItem9";
this.toolStripMenuItem9.Size = new System.Drawing.Size(112, 22); this.toolStripMenuItem9.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem9.Text = "75%"; this.toolStripMenuItem9.Text = "75%";
this.toolStripMenuItem9.Click += new System.EventHandler(this.toolStripMenuItem9_Click); this.toolStripMenuItem9.Click += new System.EventHandler(this.toolStripMenuItem9_Click);
// //
// toolStripMenuItem10 // toolStripMenuItem10
// //
this.toolStripMenuItem10.Name = "toolStripMenuItem10"; this.toolStripMenuItem10.Name = "toolStripMenuItem10";
this.toolStripMenuItem10.Size = new System.Drawing.Size(112, 22); this.toolStripMenuItem10.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem10.Text = "80%"; this.toolStripMenuItem10.Text = "80%";
this.toolStripMenuItem10.Click += new System.EventHandler(this.toolStripMenuItem10_Click); this.toolStripMenuItem10.Click += new System.EventHandler(this.toolStripMenuItem10_Click);
// //
// toolStripMenuItem11 // toolStripMenuItem11
// //
this.toolStripMenuItem11.Name = "toolStripMenuItem11"; this.toolStripMenuItem11.Name = "toolStripMenuItem11";
this.toolStripMenuItem11.Size = new System.Drawing.Size(112, 22); this.toolStripMenuItem11.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem11.Text = "85%"; this.toolStripMenuItem11.Text = "85%";
this.toolStripMenuItem11.Click += new System.EventHandler(this.toolStripMenuItem11_Click); this.toolStripMenuItem11.Click += new System.EventHandler(this.toolStripMenuItem11_Click);
// //
// toolStripMenuItem12 // toolStripMenuItem12
// //
this.toolStripMenuItem12.Name = "toolStripMenuItem12"; this.toolStripMenuItem12.Name = "toolStripMenuItem12";
this.toolStripMenuItem12.Size = new System.Drawing.Size(112, 22); this.toolStripMenuItem12.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem12.Text = "90%"; this.toolStripMenuItem12.Text = "90%";
this.toolStripMenuItem12.Click += new System.EventHandler(this.toolStripMenuItem12_Click); this.toolStripMenuItem12.Click += new System.EventHandler(this.toolStripMenuItem12_Click);
// //
// toolStripMenuItem13 // toolStripMenuItem13
// //
this.toolStripMenuItem13.Name = "toolStripMenuItem13"; this.toolStripMenuItem13.Name = "toolStripMenuItem13";
this.toolStripMenuItem13.Size = new System.Drawing.Size(112, 22); this.toolStripMenuItem13.Size = new System.Drawing.Size(180, 22);
this.toolStripMenuItem13.Text = "95%"; this.toolStripMenuItem13.Text = "95%";
this.toolStripMenuItem13.Click += new System.EventHandler(this.toolStripMenuItem13_Click); this.toolStripMenuItem13.Click += new System.EventHandler(this.toolStripMenuItem13_Click);
// //
// toolStripMenuItem4 // toolStripMenuItem4
// //
this.toolStripMenuItem4.Name = "toolStripMenuItem4"; this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(145, 6); this.toolStripMenuItem4.Size = new System.Drawing.Size(177, 6);
// //
// 插入ToolStripMenuItem // 插入ToolStripMenuItem
// //
this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "插入ToolStripMenuItem"; this.ToolStripMenuItem.Name = "插入ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(148, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "插入"; this.ToolStripMenuItem.Text = "插入";
// //
// 插入时间ToolStripMenuItem // 插入时间ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "插入时间ToolStripMenuItem"; this.ToolStripMenuItem.Name = "插入时间ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "插入时间"; this.ToolStripMenuItem.Text = "插入时间";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
@ -368,6 +370,20 @@
this.PnlBottom.Size = new System.Drawing.Size(345, 25); this.PnlBottom.Size = new System.Drawing.Size(345, 25);
this.PnlBottom.TabIndex = 2; this.PnlBottom.TabIndex = 2;
// //
// LblImage
//
this.LblImage.AutoSize = true;
this.LblImage.BackColor = System.Drawing.Color.Transparent;
this.LblImage.Cursor = System.Windows.Forms.Cursors.Hand;
this.LblImage.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LblImage.Location = new System.Drawing.Point(153, 6);
this.LblImage.Name = "LblImage";
this.LblImage.Size = new System.Drawing.Size(22, 14);
this.LblImage.TabIndex = 6;
this.LblImage.Text = "图";
this.toolTip1.SetToolTip(this.LblImage, "插入图片");
this.LblImage.Click += new System.EventHandler(this.LblImage_Click);
//
// LblBullet // LblBullet
// //
this.LblBullet.AutoSize = true; this.LblBullet.AutoSize = true;
@ -443,24 +459,19 @@
this.timer1.Interval = 400; this.timer1.Interval = 400;
this.timer1.Tick += new System.EventHandler(this.Timer1_Tick); this.timer1.Tick += new System.EventHandler(this.Timer1_Tick);
// //
// LblImage
//
this.LblImage.AutoSize = true;
this.LblImage.BackColor = System.Drawing.Color.Transparent;
this.LblImage.Cursor = System.Windows.Forms.Cursors.Hand;
this.LblImage.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.LblImage.Location = new System.Drawing.Point(153, 6);
this.LblImage.Name = "LblImage";
this.LblImage.Size = new System.Drawing.Size(22, 14);
this.LblImage.TabIndex = 6;
this.LblImage.Text = "图";
this.toolTip1.SetToolTip(this.LblImage, "插入图片");
this.LblImage.Click += new System.EventHandler(this.LblImage_Click);
//
// openFileDialog1 // openFileDialog1
// //
this.openFileDialog1.Filter = "图片|*.jpg;*.bmp;*.gif;*.png"; this.openFileDialog1.Filter = "图片|*.jpg;*.bmp;*.gif;*.png";
// //
// 靠边隐藏ToolStripMenuItem
//
this.ToolStripMenuItem.Checked = true;
this.ToolStripMenuItem.CheckOnClick = true;
this.ToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.ToolStripMenuItem.Name = "靠边隐藏ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.ToolStripMenuItem.Text = "靠边隐藏";
//
// FrmSticky // FrmSticky
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -479,6 +490,7 @@
this.Load += new System.EventHandler(this.FrmSticky_Load); this.Load += new System.EventHandler(this.FrmSticky_Load);
this.ResizeEnd += new System.EventHandler(this.FrmSticky_ResizeEnd); this.ResizeEnd += new System.EventHandler(this.FrmSticky_ResizeEnd);
this.LocationChanged += new System.EventHandler(this.FrmSticky_LocationChanged); this.LocationChanged += new System.EventHandler(this.FrmSticky_LocationChanged);
this.SizeChanged += new System.EventHandler(this.FrmSticky_SizeChanged);
this.Resize += new System.EventHandler(this.FrmSticky_Resize); this.Resize += new System.EventHandler(this.FrmSticky_Resize);
this.MenuNote.ResumeLayout(false); this.MenuNote.ResumeLayout(false);
this.PnlTop.ResumeLayout(false); this.PnlTop.ResumeLayout(false);
@ -534,5 +546,6 @@
private System.Windows.Forms.Label LblBullet; private System.Windows.Forms.Label LblBullet;
private System.Windows.Forms.Label LblImage; private System.Windows.Forms.Label LblImage;
private System.Windows.Forms.OpenFileDialog openFileDialog1; private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
} }
} }

View File

@ -6,6 +6,7 @@ using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
@ -13,6 +14,8 @@ namespace TimeClock.DbOp
{ {
public partial class FrmSticky : Form public partial class FrmSticky : Form
{ {
internal AnchorStyles StopAanhor = AnchorStyles.Top;
bool hideFlag = false;
public FrmSticky() public FrmSticky()
{ {
InitializeComponent(); InitializeComponent();
@ -260,6 +263,7 @@ namespace TimeClock.DbOp
mStor.SetAttrValue("Height", this. Height); mStor.SetAttrValue("Height", this. Height);
mStor.SetAttrValue("TopMost", this.TopMost); mStor.SetAttrValue("TopMost", this.TopMost);
mStor.SetAttrValue("Opacity", this.Opacity); mStor.SetAttrValue("Opacity", this.Opacity);
mStor.SetAttrValue("PullOverHide", this.ToolStripMenuItem.Checked);
mySQL.AddField("Setting", mStor.XMLText); mySQL.AddField("Setting", mStor.XMLText);
mySQL.AddField("editTime", DateTime.Now); mySQL.AddField("editTime", DateTime.Now);
DataProvider mydb = new DataProvider(); DataProvider mydb = new DataProvider();
@ -314,6 +318,12 @@ namespace TimeClock.DbOp
mStor.SelectNodeBySet(); mStor.SelectNodeBySet();
this.Location = new Point(mStor.GetAttrValue("Left", 0), mStor.GetAttrValue("Top", 0)); this.Location = new Point(mStor.GetAttrValue("Left", 0), mStor.GetAttrValue("Top", 0));
this.Size = new Size(mStor.GetAttrValue("Width", 0), mStor.GetAttrValue("Height", 0)); this.Size = new Size(mStor.GetAttrValue("Width", 0), mStor.GetAttrValue("Height", 0));
if (this.Top < 0) { this.Top = 0; }
if (this.Left < 0) { this.Left = 0; }
var screen = Screen.GetWorkingArea(this);
if (this.Top > screen.Bottom) { this.Top = screen.Bottom-this.Height; }
if (this.Left > screen.Right) { this.Left = screen.Right - this.Width; }
if (this.Left < 0) { this.Left = 0; }
this.TopMost = mStor.GetAttrValue("TopMost", false); this.TopMost = mStor.GetAttrValue("TopMost", false);
this.Opacity = mStor.GetAttrValue("Opacity", 0d); this.Opacity = mStor.GetAttrValue("Opacity", 0d);
try try
@ -321,6 +331,7 @@ namespace TimeClock.DbOp
StickyBackColor = ColorTranslator.FromHtml(mStor.GetAttrValue("StickyBackColor")); StickyBackColor = ColorTranslator.FromHtml(mStor.GetAttrValue("StickyBackColor"));
} }
catch { } catch { }
this.ToolStripMenuItem.Checked = mStor.GetAttrValue("PullOverHide", true);
#endregion #endregion
} }
} }
@ -365,7 +376,8 @@ namespace TimeClock.DbOp
dt_change = DateTime.Now; dt_change = DateTime.Now;
isChange = true; isChange = true;
} }
[DllImport("User32.dll")]
private static extern bool PtInRect(ref Rectangle Rects, Point lpPoint);
private void Timer1_Tick(object sender, EventArgs e) private void Timer1_Tick(object sender, EventArgs e)
{ {
if(isChange && dt_change.AddMilliseconds(delayTime)<DateTime.Now) if(isChange && dt_change.AddMilliseconds(delayTime)<DateTime.Now)
@ -383,9 +395,32 @@ namespace TimeClock.DbOp
if (PnlTop.Visible) PnlTop.Visible = false; if (PnlTop.Visible) PnlTop.Visible = false;
if (PnlBottom.Visible) PnlBottom.Visible = false; if (PnlBottom.Visible) PnlBottom.Visible = false;
} }
if (this.WindowState == FormWindowState.Normal && ToolStripMenuItem.Checked)
{
System.Drawing.Point cursorPoint = new Point(Cursor.Position.X, Cursor.Position.Y);//获取鼠标在屏幕的坐标点
Rectangle Rects = new Rectangle(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);//存储当前窗体在屏幕的所在区域
bool prInRect = PtInRect(ref Rects, cursorPoint);
if (prInRect)
{//当鼠标在当前窗体内
if (this.Top < 0)//窗体的Top属性小于0
this.Top = 0;
else if (this.Left < 0)//窗体的Left属性小于0
this.Left = 0;
else if (this.Right > Screen.PrimaryScreen.WorkingArea.Width)//窗体的Right属性大于屏幕宽度
this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width;
}
else
{
int space = 8;
if (this.Top < 5) //当窗体的上边框与屏幕的顶端的距离小于5时
this.Top = 7 - this.Height + space; //将窗体隐藏到屏幕的顶端
else if (this.Left < 5) //当窗体的左边框与屏幕的左端的距离小于5时
this.Left = 5 - this.Width + space; //将窗体隐藏到屏幕的左端
else if (this.Right > Screen.PrimaryScreen.WorkingArea.Width - 5)//当窗体的右边框与屏幕的右端的距离小于5时
this.Left = Screen.PrimaryScreen.WorkingArea.Width - 5 - space;//将窗体隐藏到屏幕的右端
}
}
} }
private void ToolStripMenuItem_Click(object sender, EventArgs e) private void ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
txtContent.SelectedText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); txtContent.SelectedText = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
@ -464,5 +499,9 @@ namespace TimeClock.DbOp
} }
} }
} }
private void FrmSticky_SizeChanged(object sender, EventArgs e)
{
}
} }
} }

View File

@ -123,9 +123,6 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>204, 17</value> <value>204, 17</value>
</metadata> </metadata>

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2103.1001")] [assembly: AssemblyVersion("1.0.2110.1601")]
[assembly: AssemblyFileVersion("1.0.2103.1001")] [assembly: AssemblyFileVersion("1.0.2110.1601")]

View File

@ -73,6 +73,7 @@
<Compile Include="API\RichImg.cs" /> <Compile Include="API\RichImg.cs" />
<Compile Include="API\SoundPlay.cs" /> <Compile Include="API\SoundPlay.cs" />
<Compile Include="API\SpVoice.cs" /> <Compile Include="API\SpVoice.cs" />
<Compile Include="API\TinyBook.cs" />
<Compile Include="DbOp\Custom.cs" /> <Compile Include="DbOp\Custom.cs" />
<Compile Include="DbOp\CustomShow\DJSDayUI.cs"> <Compile Include="DbOp\CustomShow\DJSDayUI.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>