📄 frmmain.cs
字号:
UIBufGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_CPANEL, new Rectangle(168, 43, 7, 7));
/// Draw text
UIBufGraphics.DrawImage(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_MAINBG, new Rectangle(23, 41, 48, 11), new Rectangle(23, 41, 48, 11), GraphicsUnit.Pixel);
UIBufGraphics.DrawImage(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_MAINBG, new Rectangle(95, 41, 66, 11), new Rectangle(95, 41, 66, 11), GraphicsUnit.Pixel);
UIBufGraphics.DrawString(NowPanel, ft_This, sb_Black, new Point(21, 41));
UIBufGraphics.DrawString(OtherPanel, ft_This, sb_Black, new Point(95, 41));
if (Panel_Draw != null)
{
UIBufGraphics.DrawImage(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_MAINBG, new Rectangle(2, 54, 178, 343), new Rectangle(2, 54, 178, 343), GraphicsUnit.Pixel);
Panel_Draw();
}
UIFGraphics.DrawImageUnscaledAndClipped(UIBuffer, new Rectangle(0, 0, 188, 430));
}
private void DrawNowBut_Current_Move(int CurBut)
{
if (NowBut == NOWBUT_LAST)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_LAST, new Rectangle(7, 36, 11, 17));
}
else if (NowBut == NOWBUT_NEXT)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_NEXT, new Rectangle(75, 36, 11, 17));
}
else if (NowBut == NOWBUT_CPANEL)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_CPANEL, new Rectangle(168, 43, 7, 7));
}
NowBut = CurBut;
if (NowBut == NOWBUT_CPANEL)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_CPANEL_MOVE, new Rectangle(168, 43, 7, 7));
}
}
private void DrawNowBut_Current_Down()
{
if (NowBut == NOWBUT_LAST)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_LAST_DOWN, new Rectangle(7, 36, 11, 17));
}
else if (NowBut == NOWBUT_NEXT)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_NEXT_DOWN, new Rectangle(75, 36, 11, 17));
}
else if (NowBut == NOWBUT_CPANEL)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_CPANEL_DOWN, new Rectangle(168, 43, 7, 7));
mnuCPanel.Show(this.PointToScreen(new Point(171 - mnuCPanel.Width, 46)));
}
}
private void DrawNowBut_Current_Up()
{
if (NowBut == NOWBUT_LAST)
{
// FGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_LAST, new Rectangle(7, 36, 11, 17));
ChangePanel(PanelIndex - 1);
}
else if (NowBut == NOWBUT_NEXT)
{
// FGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_NEXT, new Rectangle(75, 36, 11, 17));
ChangePanel(PanelIndex + 1);
}
else if (NowBut == NOWBUT_CPANEL)
{
UIFGraphics.DrawImageUnscaledAndClipped(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_CPANEL, new Rectangle(168, 43, 7, 7));
}
}
private void frmMain_MouseMove(object sender, MouseEventArgs e)
{
int X, Y;
X = e.X;
Y = e.Y;
if (X > 7 && X < 18 && Y > 36 && Y < 53)
{
if (NowBut != NOWBUT_LAST)
{
DrawNowBut_Current_Move(NOWBUT_LAST);
}
}
else if (X > 75 && X < 86 && Y > 36 && Y < 53)
{
if (NowBut != NOWBUT_NEXT)
{
DrawNowBut_Current_Move(NOWBUT_NEXT);
}
}
else if (X > 168 && X < 175 && Y > 43 && Y < 50)
{
if (NowBut != NOWBUT_CPANEL)
{
DrawNowBut_Current_Move(NOWBUT_CPANEL);
}
}
else if (Panel_NB_Move != null)
{
Panel_NB_Move(X, Y);
}
}
private void frmMain_MouseDown(object sender, MouseEventArgs e)
{
DrawNowBut_Current_Down();
if (Panel_DrawNB_Down != null)
{
Panel_DrawNB_Down();
}
}
private void frmMain_MouseUp(object sender, MouseEventArgs e)
{
DrawNowBut_Current_Up();
if (Panel_DrawNB_Up != null)
{
Panel_DrawNB_Up();
}
}
private void frmMain_MouseLeave(object sender, EventArgs e)
{
NowBut = NOWBUT_NULL;
}
private void vsbFriends_ValueChanged(object sender, EventArgs e)
{
Rectangle t_rect = new Rectangle(2, 54, 178, 343);
NowFLStartRow = vsbFriends.Value;
UIBufGraphics.DrawImage(global::JPMLab_LanTalker_Client.Properties.Resources.BMP_MAINBG, t_rect, t_rect, GraphicsUnit.Pixel);
Panel_Draw_Friends();
UIFGraphics.DrawImage(UIBuffer, t_rect, t_rect, GraphicsUnit.Pixel);
}
private void notMain_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (OperationCenter.DirTalkForm() == false)
{
this.Visible = true;
}
}
private void frmMain_MouseClick(object sender, MouseEventArgs e)
{
if (PanelIndex == PANEL_FRIENDS && NowUser_Move != -1)
{
if (e.Button == MouseButtons.Left)
{
OperationCenter.TalkWith(NowFLStartRow + NowUser_Move);
}
else if (e.Button == MouseButtons.Right)
{
Point t_point = new Point(e.X, e.Y);
t_point = PointToScreen(t_point);
mnuFriendOpt.Show(t_point.X, t_point.Y);
}
}
}
private void mitAddFriend_Click(object sender, EventArgs e)
{
new frmAllLTer().Show();
}
private void mitPanelNews_Click(object sender, EventArgs e)
{
ChangePanel(PANEL_NEWS);
}
private void mitPanelFriends_Click(object sender, EventArgs e)
{
ChangePanel(PANEL_FRIENDS);
}
private void mitPanelLogin_Click(object sender, EventArgs e)
{
ChangePanel(PANEL_LOGIN);
}
private void mitMyInfo_Click(object sender, EventArgs e)
{
new frmUserInfo(OperationCenter.CurrentMe, true).Show();
}
private void mitSystemOption_Click(object sender, EventArgs e)
{
new frmSystemOption().Show();
}
private void mitRegister_Click(object sender, EventArgs e)
{
new frmRegister().Show();
}
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (UIFGraphics != null)
{
UIFGraphics.Dispose();
}
if (UIBufGraphics != null)
{
UIBufGraphics.Dispose();
}
if (thdCartoonLogo.ThreadState == ThreadState.Suspended)
{
thdCartoonLogo.Resume();
}
thdCartoonLogo.Abort();
OperationCenter.DisconnectServer();
OperationCenter.StopListener();
}
private void mitOperate_MouseDown(object sender, MouseEventArgs e)
{
if (OperationCenter.CurrentMe == null)
{
mitAddFriend.Enabled = false;
mitMyInfo.Enabled = false;
}
else
{
mitAddFriend.Enabled = true;
mitMyInfo.Enabled = true;
}
}
private void mitLogin_Click(object sender, EventArgs e)
{
ChangePanel(PANEL_LOGIN);
}
private void mitFrineds_Click(object sender, EventArgs e)
{
ChangePanel(PANEL_FRIENDS);
}
private void mitNews_Click(object sender, EventArgs e)
{
ChangePanel(PANEL_NEWS);
}
private void mitTalkWith_Click(object sender, EventArgs e)
{
OperationCenter.TalkWith(NowFLStartRow + NowUser_Move);
}
private void mitDeleteHim_Click(object sender, EventArgs e)
{
OperationCenter.DeleteFriend(NowFLStartRow + NowUser_Move);
}
private void mnuFriendOpt_Opening(object sender, CancelEventArgs e)
{
if (NowFLStartRow + NowUser_Move > OperationCenter._FriendList.Count)
{
mitTalkWith.Enabled = false;
mitDeleteHim.Enabled = false;
}
else
{
mitTalkWith.Enabled = true;
mitDeleteHim.Enabled = true;
}
}
private void mitHisInfo_Click(object sender, EventArgs e)
{
int t_n = NowFLStartRow + NowUser_Move;
if (t_n > -1 && t_n < OperationCenter._FriendList.Count)
{
new frmUserInfo((icUser)OperationCenter._FriendList[t_n]).Show();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -