-
Notifications
You must be signed in to change notification settings - Fork 76
/
MyStatusBar.cpp
101 lines (76 loc) · 2.01 KB
/
MyStatusBar.cpp
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
// MyStatusBar.cpp : implementation file
//
#include "stdafx.h"
#include "mushclient.h"
#include "mainfrm.h"
#include "MyStatusBar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyStatusBar
CMyStatusBar::CMyStatusBar()
{
}
CMyStatusBar::~CMyStatusBar()
{
}
BEGIN_MESSAGE_MAP(CMyStatusBar, CStatusBar)
//{{AFX_MSG_MAP(CMyStatusBar)
ON_WM_LBUTTONDBLCLK()
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyStatusBar message handlers
void CMyStatusBar::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// CStatusBar::OnLButtonDblClk(nFlags, point);
RECT rect;
// see which pane they double-clicked in
if (GetStatusBarCtrl ().GetRect
(CommandToIndex (ID_STATUSLINE_TIME), &rect ))
{
// if in it, post message to clear the connected time
if (PtInRect (&rect, point))
{
Frame.SendMessage (WM_COMMAND, ID_GAME_RESETCONNECTEDTIME, 0);
return;
}
}
if (GetStatusBarCtrl ().GetRect
(CommandToIndex (ID_STATUSLINE_FREEZE), &rect ))
{
// if in it, post message to clear the connected time
if (PtInRect (&rect, point))
{
Frame.SendMessage (WM_COMMAND, ID_DISPLAY_FREEZEOUTPUT, 0);
return;
}
}
if (GetStatusBarCtrl ().GetRect
(CommandToIndex (ID_STATUSLINE_LINES), &rect ))
{
// if in it, post message to open the "go to line" dialog
if (PtInRect (&rect, point))
{
Frame.SendMessage (WM_COMMAND, ID_DISPLAY_GOTOLINE, 0);
return;
}
}
}
void CMyStatusBar::OnLButtonDown(UINT nFlags, CPoint point)
{
// CStatusBar::OnLButtonDown(nFlags, point);
RECT rect;
// see which pane they clicked in
if (GetStatusBarCtrl ().GetRect (CommandToIndex (ID_STATUSLINE_MUSHNAME), &rect ))
{
if (PtInRect (&rect, point))
{
Frame.LeftTrayClick ();
}
}
}