Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
1 Star 0 Fork 122

库卡青年/DevelopAssistant

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (1)
Tags (3)
master
V5.0.2
V4.8.32
V4.3.31
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
The license selected for the repository is subject to the license used by the main branch of the repository.
master
Branches (1)
Tags (3)
master
V5.0.2
V4.8.32
V4.3.31
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (1)
Tags (3)
master
V5.0.2
V4.8.32
V4.3.31
ControlBoxManager.cs 7.76 KB
Copy Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using ICSharpCode.WinFormsUI.Forms;
using ICSharpCode.WinFormsUI.NGraphics;
namespace ICSharpCode.WinFormsUI.Core
{
internal delegate bool DelegateWindowState();
public class ControlBoxManager
{
private BaseForm _owner;
private RenderControlButton closeBtn;
private RenderControlButton maxBtn;
private RenderControlButton resBtn;
private RenderControlButton minBtn;
#region event handler
private void CloseBtnClick(object sender, EventArgs e)
{
if (_owner.CloseBox)
_owner.Close();
}
private void MaxBtnClick(object sender, EventArgs e)
{
_owner.WindowState = FormWindowState.Maximized;
if (_owner.MaximumSize == _owner.ClientSize)
FormResize();
}
private void ResBtnClick(object sender, EventArgs e)
{
_owner.WindowState = FormWindowState.Normal;
if (_owner.MaximumSize == _owner.ClientSize)
FormResize();
}
private void MinBtnClick(object sender, EventArgs e)
{
_owner.WindowState = FormWindowState.Minimized;
}
#endregion
private void SetControlBoxColor()
{
closeBtn.ColorTable = _owner.XTheme.CloseBoxColor;
closeBtn.BackImageNormal = _owner.XTheme.CloseBoxBackImageNormal;
closeBtn.BackImageHover = _owner.XTheme.CloseBoxBackImageHover;
closeBtn.BackImagePressed = _owner.XTheme.CloseBoxBackImagePressed;
// max res box
if (_owner.MaximizeBox)
{
maxBtn.ColorTable = _owner.XTheme.MaxBoxColor;
maxBtn.BackImageNormal = _owner.XTheme.MaxBoxBackImageNormal;
maxBtn.BackImageHover = _owner.XTheme.MaxBoxBackImageHover;
maxBtn.BackImagePressed = _owner.XTheme.MaxBoxBackImagePressed;
resBtn.ColorTable = _owner.XTheme.MaxBoxColor;
resBtn.BackImageNormal = _owner.XTheme.ResBoxBackImageNormal;
resBtn.BackImageHover = _owner.XTheme.ResBoxBackImageHover;
resBtn.BackImagePressed = _owner.XTheme.ResBoxBackImagePressed;
}
// min box
if (_owner.MinimizeBox)
{
minBtn.ColorTable = _owner.XTheme.MinBoxColor;
minBtn.BackImageNormal = _owner.XTheme.MinBoxBackImageNormal;
minBtn.BackImageHover = _owner.XTheme.MinBoxBackImageHover;
minBtn.BackImagePressed = _owner.XTheme.MinBoxBackImagePressed;
}
}
private void ControlBoxInit()
{
// close box
if (_owner.CloseBox)
{
closeBtn = new RenderControlButton(_owner);
closeBtn.Visible = true;
closeBtn.Bounds = _owner.CloseBoxRect;
closeBtn.Click += new EventHandler(CloseBtnClick);
closeBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateCloseFlagPath);
}
// max res box
if (_owner.MaximizeBox)
{
maxBtn = new RenderControlButton(_owner);
resBtn = new RenderControlButton(_owner);
if (_owner.WindowState == FormWindowState.Normal)
{
maxBtn.Visible = true;
resBtn.Visible = false;
}
else
{
maxBtn.Visible = false;
resBtn.Visible = true;
}
maxBtn.Bounds = _owner.MaxBoxRect;
resBtn.Bounds = _owner.MaxBoxRect;
maxBtn.Click += new EventHandler(MaxBtnClick);
maxBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMaximizeFlagPath);
resBtn.Click += new EventHandler(ResBtnClick);
resBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateRestoreFlagPath);
}
// min box
if (_owner.MinimizeBox)
{
minBtn = new RenderControlButton(_owner);
minBtn.Visible = true;
minBtn.Bounds = _owner.MinBoxRect;
minBtn.Click += new EventHandler(MinBtnClick);
minBtn.ForePathGetter = new ButtonForePathGetter(
GraphicsPathHelper.CreateMinimizeFlagPath);
}
SetControlBoxColor();
}
public ControlBoxManager(BaseForm owner)
{
_owner = owner;
ControlBoxInit();
}
public void FormResize()
{
if (maxBtn != null)
{
if (_owner.WindowState == FormWindowState.Normal)
{
maxBtn.Visible = true;
resBtn.Visible = false;
resBtn.State = ButtonState.Normal;
}
else if (_owner.WindowState != FormWindowState.Minimized)
{
resBtn.Visible = true;
maxBtn.Visible = false;
maxBtn.State = ButtonState.Normal;
}
resBtn.Bounds = maxBtn.Bounds = _owner.MaxBoxRect;
}
if (minBtn != null)
minBtn.Bounds = _owner.MinBoxRect;
if (closeBtn != null)
closeBtn.Bounds = _owner.CloseBoxRect;
}
public void FormResize(bool WindowState)
{
if (maxBtn != null)
{
if (WindowState)
{
resBtn.Visible = true;
maxBtn.Visible = false;
maxBtn.State = ButtonState.Normal;
}
else
{
maxBtn.Visible = true;
resBtn.Visible = false;
resBtn.State = ButtonState.Normal;
}
resBtn.Bounds = maxBtn.Bounds = _owner.MaxBoxRect;
}
if (minBtn != null)
minBtn.Bounds = _owner.MinBoxRect;
if (closeBtn != null)
closeBtn.Bounds = _owner.CloseBoxRect;
}
internal void FormResize(DelegateWindowState WindowState)
{
FormResize(WindowState.Invoke());
}
public void MouseOperation(Point location, MouseOperationType type)
{
if (closeBtn != null && closeBtn.Visible)
closeBtn.MouseOperation(location, type);
if (maxBtn != null && maxBtn.Visible)
maxBtn.MouseOperation(location, type);
if(resBtn!=null && resBtn.Visible)
resBtn.MouseOperation(location, type);
if(minBtn!=null)
minBtn.MouseOperation(location, type);
}
public void DrawBoxes(System.Drawing.Graphics g)
{
if (_owner.ControlBox)
{
if (_owner.CloseBox && closeBtn != null)
closeBtn.DrawButton(g);
if (_owner.MinimizeBox && minBtn != null)
minBtn.DrawButton(g);
if (_owner.MaximizeBox)
{
if (maxBtn != null & maxBtn.Visible)
maxBtn.DrawButton(g);
if (resBtn != null && resBtn.Visible)
resBtn.DrawButton(g);
}
}
}
public void ResetBoxColor()
{
SetControlBoxColor();
}
}
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

开发助手是一款面向开发人员的辅助助手,它集数据库管理(目前支持sqlserver,sqlite,mysql,postgresql),代码生成(支持从数据库生成实体映射类,数据库操作DAL中间层),数据库文档生成,代码收藏夹(支持C#,SQL,Javascrip,Html,XML,Python语法高亮),富文本编辑,插件管理等功能模块。自2015年到如今,它已经历过4个重大版本的升级,径过不断修复和完善,目前已成为一款堪称得心应手的开发辅助工具。
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/wwwpythonpw/DevelopAssistant.git
git@gitee.com:wwwpythonpw/DevelopAssistant.git
wwwpythonpw
DevelopAssistant
DevelopAssistant
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /