Browse files

Code cleanup

  • Loading branch information...
1 parent 9da8693 commit 9375b5013c0e88555c0f91fc6b2550ae220d2b3b @spx268 spx268 committed Jan 16, 2013
Showing with 141 additions and 217 deletions.
  1. +3 −13 Library/Meter.cpp
  2. +20 −13 Library/MeterWindow.cpp
  3. +39 −130 Library/Mouse.cpp
  4. +79 −61 Library/Mouse.h
View
16 Library/Meter.cpp
@@ -53,6 +53,7 @@ CMeter::CMeter(CMeterWindow* meterWindow, const WCHAR* name) : CSection(meterWin
m_ToolTipType(false),
m_ToolTipHidden(meterWindow->GetMeterToolTipHidden()),
m_ToolTipHandle(),
+ m_Mouse(meterWindow, this),
m_HasMouseAction(false),
m_MouseOver(false),
m_RelativeX(POSITION_ABSOLUTE),
@@ -322,19 +323,8 @@ void CMeter::ReadOptions(CConfigParser& parser, const WCHAR* section)
m_OnUpdateAction = parser.ReadString(section, L"OnUpdateAction", L"", false);
- m_Mouse.ReadOptions(parser, section, m_MeterWindow);
-
- m_HasMouseAction =
- !(m_Mouse.GetLeftUpAction().empty() && m_Mouse.GetLeftDownAction().empty() &&
- m_Mouse.GetLeftDoubleClickAction().empty() && m_Mouse.GetMiddleUpAction().empty() &&
- m_Mouse.GetMiddleDownAction().empty() && m_Mouse.GetMiddleDoubleClickAction().empty() &&
- m_Mouse.GetRightUpAction().empty() && m_Mouse.GetRightDownAction().empty() &&
- m_Mouse.GetRightDoubleClickAction().empty() && m_Mouse.GetX1UpAction().empty() &&
- m_Mouse.GetX1DownAction().empty() && m_Mouse.GetX1DoubleClickAction().empty() &&
- m_Mouse.GetX2UpAction().empty() && m_Mouse.GetX2DownAction().empty() &&
- m_Mouse.GetX2DoubleClickAction().empty() && m_Mouse.GetMouseScrollDownAction().empty() &&
- m_Mouse.GetMouseScrollLeftAction().empty() && m_Mouse.GetMouseScrollRightAction().empty() &&
- m_Mouse.GetMouseScrollUpAction().empty());
+ m_Mouse.ReadOptions(parser, section);
+ m_HasMouseAction = m_Mouse.HasButtonAction() || m_Mouse.HasScrollAction();
m_ToolTipText = parser.ReadString(section, L"ToolTipText", L"");
m_ToolTipTitle = parser.ReadString(section, L"ToolTipTitle", L"");
View
33 Library/MeterWindow.cpp
@@ -82,6 +82,7 @@ CMeterWindow::CMeterWindow(const std::wstring& folderPath, const std::wstring& f
m_Background(),
m_BackgroundSize(),
m_Window(),
+ m_Mouse(this),
m_MouseOver(false),
m_MouseInputRegistered(false),
m_HasMouseScrollAction(false),
@@ -215,6 +216,7 @@ void CMeterWindow::Dispose(bool refresh)
KillTimer(m_Window, TIMER_TRANSITION);
UnregisterMouseInput();
+ m_HasMouseScrollAction = false;
m_ActiveTransition = false;
@@ -2043,7 +2045,7 @@ bool CMeterWindow::ReadSkin()
}
}
- m_Mouse.ReadOptions(m_Parser, L"Rainmeter", this);
+ m_Mouse.ReadOptions(m_Parser, L"Rainmeter");
m_OnRefreshAction = m_Parser.ReadString(L"Rainmeter", L"OnRefreshAction", L"", false);
m_OnCloseAction = m_Parser.ReadString(L"Rainmeter", L"OnCloseAction", L"", false);
@@ -4300,7 +4302,7 @@ LRESULT CMeterWindow::OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam)
*/
bool CMeterWindow::DoAction(int x, int y, MOUSEACTION action, bool test)
{
- std::wstring command = L"";
+ std::wstring command;
// Check if the hitpoint was over some meter
std::vector<CMeter*>::const_reverse_iterator j = m_Meters.rbegin();
@@ -4309,17 +4311,20 @@ bool CMeterWindow::DoAction(int x, int y, MOUSEACTION action, bool test)
// Hidden meters are ignored
if ((*j)->IsHidden()) continue;
- std::wstring meterCommand = (*j)->GetMouse().GetActionCommand(action);
- if (!meterCommand.empty() && (*j)->HitTest(x, y))
+ const CMouse& mouse = (*j)->GetMouse();
+ if (mouse.HasActionCommand(action) && (*j)->HitTest(x, y))
{
- command = meterCommand;
+ command = mouse.GetActionCommand(action);
break;
}
}
- if (command.empty() && HitTest(x, y))
+ if (command.empty())
{
- command = m_Mouse.GetActionCommand(action).c_str();
+ if (m_Mouse.HasActionCommand(action) && HitTest(x, y))
+ {
+ command = m_Mouse.GetActionCommand(action);
+ }
}
if (!command.empty())
@@ -4388,17 +4393,18 @@ bool CMeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
if (!(*j)->IsMouseOver())
{
- if (!((*j)->GetMouse().GetOverAction().empty()) ||
- !((*j)->GetMouse().GetLeaveAction().empty()) ||
+ const CMouse& mouse = (*j)->GetMouse();
+ if (!mouse.GetOverAction().empty() ||
+ !mouse.GetLeaveAction().empty() ||
button)
{
//LogWithArgs(LOG_DEBUG, L"MeterEnter: %s - [%s]", m_FolderPath.c_str(), (*j)->GetName());
(*j)->SetMouseOver(true);
- if (!((*j)->GetMouse().GetOverAction().empty()))
+ if (!mouse.GetOverAction().empty())
{
UINT currCounter = m_MouseMoveCounter;
- Rainmeter->ExecuteCommand((*j)->GetMouse().GetOverAction().c_str(), this);
+ Rainmeter->ExecuteCommand(mouse.GetOverAction().c_str(), this);
return (currCounter == m_MouseMoveCounter);
}
}
@@ -4421,9 +4427,10 @@ bool CMeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
//LogWithArgs(LOG_DEBUG, L"MeterLeave: %s - [%s]", m_FolderPath.c_str(), (*j)->GetName());
(*j)->SetMouseOver(false);
- if (!((*j)->GetMouse().GetLeaveAction().empty()))
+ const CMouse& mouse = (*j)->GetMouse();
+ if (!mouse.GetLeaveAction().empty())
{
- Rainmeter->ExecuteCommand((*j)->GetMouse().GetLeaveAction().c_str(), this);
+ Rainmeter->ExecuteCommand(mouse.GetLeaveAction().c_str(), this);
return true;
}
}
View
169 Library/Mouse.cpp
@@ -23,11 +23,10 @@
#include "Litestep.h"
#include "Mouse.h"
-CMouse::CMouse() :
+CMouse::CMouse(CMeterWindow* meterWindow, CMeter* meter) : m_MeterWindow(meterWindow), m_Meter(meter),
m_CursorType(MOUSECURSOR_HAND),
m_CustomCursor(),
- m_CursorState(true),
- m_MeterWindow()
+ m_CursorState(true)
{
}
@@ -36,43 +35,36 @@ CMouse::~CMouse()
DestroyCustomCursor();
}
-void CMouse::ReadOptions(CConfigParser& parser, const WCHAR* section, CMeterWindow* meterWindow)
+void CMouse::ReadOptions(CConfigParser& parser, const WCHAR* section)
{
- m_MeterWindow = meterWindow;
- m_MeterName = section;
-
DestroyCustomCursor();
- m_LeftDownAction = parser.ReadString(section, L"LeftMouseDownAction", L"", false);
- m_RightDownAction = parser.ReadString(section, L"RightMouseDownAction", L"", false);
- m_MiddleDownAction = parser.ReadString(section, L"MiddleMouseDownAction", L"", false);
- m_X1DownAction = parser.ReadString(section, L"X1MouseDownAction", L"", false);
- m_X2DownAction = parser.ReadString(section, L"X2MouseDownAction", L"", false);
- m_LeftUpAction = parser.ReadString(section, L"LeftMouseUpAction", L"", false);
- m_RightUpAction = parser.ReadString(section, L"RightMouseUpAction", L"", false);
- m_MiddleUpAction = parser.ReadString(section, L"MiddleMouseUpAction", L"", false);
- m_X1UpAction = parser.ReadString(section, L"X1MouseUpAction", L"", false);
- m_X2UpAction = parser.ReadString(section, L"X2MouseUpAction", L"", false);
- m_LeftDoubleClickAction = parser.ReadString(section, L"LeftMouseDoubleClickAction", L"", false);
- m_RightDoubleClickAction = parser.ReadString(section, L"RightMouseDoubleClickAction", L"", false);
- m_MiddleDoubleClickAction = parser.ReadString(section, L"MiddleMouseDoubleClickAction", L"", false);
- m_X1DoubleClickAction = parser.ReadString(section, L"X1MouseDoubleClickAction", L"", false);
- m_X2DoubleClickAction = parser.ReadString(section, L"X2MouseDoubleClickAction", L"", false);
-
- m_OverAction = parser.ReadString(section, L"MouseOverAction", L"", false);
- m_LeaveAction = parser.ReadString(section, L"MouseLeaveAction", L"", false);
-
- m_MouseScrollDownAction = parser.ReadString(section, L"MouseScrollDownAction", L"", false);
- m_MouseScrollUpAction = parser.ReadString(section, L"MouseScrollUpAction", L"", false);
- m_MouseScrollLeftAction = parser.ReadString(section, L"MouseScrollLeftAction", L"", false);
- m_MouseScrollRightAction = parser.ReadString(section, L"MouseScrollRightAction", L"", false);
- if (!m_MouseScrollDownAction.empty() || !m_MouseScrollUpAction.empty() ||
- !m_MouseScrollLeftAction.empty() || !m_MouseScrollRightAction.empty())
- {
- meterWindow->SetHasMouseScrollAction();
- }
-
- const bool defaultState = (section == L"Rainmeter") ? true : meterWindow->GetMouse().GetCursorState();
+ m_MouseActions[MOUSE_LMB_UP] = parser.ReadString(section, L"LeftMouseUpAction", L"", false);
+ m_MouseActions[MOUSE_LMB_DOWN] = parser.ReadString(section, L"LeftMouseDownAction", L"", false);
+ m_MouseActions[MOUSE_LMB_DBLCLK] = parser.ReadString(section, L"LeftMouseDoubleClickAction", L"", false);
+ m_MouseActions[MOUSE_MMB_UP] = parser.ReadString(section, L"MiddleMouseUpAction", L"", false);
+ m_MouseActions[MOUSE_MMB_DOWN] = parser.ReadString(section, L"MiddleMouseDownAction", L"", false);
+ m_MouseActions[MOUSE_MMB_DBLCLK] = parser.ReadString(section, L"MiddleMouseDoubleClickAction", L"", false);
+ m_MouseActions[MOUSE_RMB_UP] = parser.ReadString(section, L"RightMouseUpAction", L"", false);
+ m_MouseActions[MOUSE_RMB_DOWN] = parser.ReadString(section, L"RightMouseDownAction", L"", false);
+ m_MouseActions[MOUSE_RMB_DBLCLK] = parser.ReadString(section, L"RightMouseDoubleClickAction", L"", false);
+ m_MouseActions[MOUSE_X1MB_UP] = parser.ReadString(section, L"X1MouseUpAction", L"", false);
+ m_MouseActions[MOUSE_X1MB_DOWN] = parser.ReadString(section, L"X1MouseDownAction", L"", false);
+ m_MouseActions[MOUSE_X1MB_DBLCLK] = parser.ReadString(section, L"X1MouseDoubleClickAction", L"", false);
+ m_MouseActions[MOUSE_X2MB_UP] = parser.ReadString(section, L"X2MouseUpAction", L"", false);
+ m_MouseActions[MOUSE_X2MB_DOWN] = parser.ReadString(section, L"X2MouseDownAction", L"", false);
+ m_MouseActions[MOUSE_X2MB_DBLCLK] = parser.ReadString(section, L"X2MouseDoubleClickAction", L"", false);
+
+ m_MouseActions[MOUSE_MW_UP] = parser.ReadString(section, L"MouseScrollUpAction", L"", false);
+ m_MouseActions[MOUSE_MW_DOWN] = parser.ReadString(section, L"MouseScrollDownAction", L"", false);
+ m_MouseActions[MOUSE_MW_LEFT] = parser.ReadString(section, L"MouseScrollLeftAction", L"", false);
+ m_MouseActions[MOUSE_MW_RIGHT] = parser.ReadString(section, L"MouseScrollRightAction", L"", false);
+
+ m_MouseActions[MOUSE_OVER] = parser.ReadString(section, L"MouseOverAction", L"", false);
+ m_MouseActions[MOUSE_LEAVE] = parser.ReadString(section, L"MouseLeaveAction", L"", false);
+
+ if (HasScrollAction())
+ {
m_MeterWindow->SetHasMouseScrollAction();
}
@@ -108,16 +100,16 @@ void CMouse::ReadOptions(CConfigParser& parser, const WCHAR* section, CMeterWind
else if (wcschr(mouseCursor, L'.'))
{
m_CursorType = MOUSECURSOR_CUSTOM;
- m_CursorType = meterWindow->GetMouse().GetCursorType();
+ }
else
{
- mouseCursor = meterWindow->GetParser().ReadString(L"Rainmeter", L"MouseActionCursorName", L"").c_str();
+ // Inherit from [Rainmeter].
m_CursorType = m_MeterWindow->GetMouse().GetCursorType();
if (m_CursorType == MOUSECURSOR_CUSTOM)
{
mouseCursor = m_MeterWindow->GetParser().ReadString(L"Rainmeter", L"MouseActionCursorName", L"").c_str();
}
- std::wstring cursorPath = meterWindow->GetResourcesPath();
+ }
if (m_CursorType == MOUSECURSOR_CUSTOM)
{
@@ -173,89 +165,8 @@ HCURSOR CMouse::GetCursor() const
}
return LoadCursor(NULL, name);
- std::wstring command = L"";
-
- switch (action)
- {
- case MOUSE_LMB_DOWN:
- command = m_LeftDownAction;
- break;
-
- case MOUSE_LMB_UP:
- command = m_LeftUpAction;
- break;
-
- case MOUSE_LMB_DBLCLK:
- command = m_LeftDoubleClickAction;
- break;
-
- case MOUSE_RMB_DOWN:
- command = m_RightDownAction;
- break;
-
- case MOUSE_RMB_UP:
- command = m_RightUpAction;
- break;
-
- case MOUSE_RMB_DBLCLK:
- command = m_RightDoubleClickAction;
- break;
-
- case MOUSE_MMB_DOWN:
- command = m_MiddleDownAction;
- break;
-
- case MOUSE_MMB_UP:
- command = m_MiddleUpAction;
- break;
-
- case MOUSE_MMB_DBLCLK:
- command = m_MiddleDoubleClickAction;
- break;
-
- case MOUSE_MW_DOWN:
- command = m_MouseScrollDownAction;
- break;
-
- case MOUSE_MW_UP:
- command = m_MouseScrollUpAction;
- break;
-
- case MOUSE_MW_LEFT:
- command = m_MouseScrollLeftAction;
- break;
-
- case MOUSE_MW_RIGHT:
- command = m_MouseScrollRightAction;
- break;
-
- case MOUSE_X1MB_DOWN:
- command = m_X1DownAction;
- break;
-
- case MOUSE_X1MB_UP:
- command = m_X1UpAction;
- break;
-
- case MOUSE_X1MB_DBLCLK:
- command = m_X1DoubleClickAction;
- break;
-
- case MOUSE_X2MB_DOWN:
- command = m_X2DownAction;
- break;
-
- case MOUSE_X2MB_UP:
- command = m_X2UpAction;
- break;
-
- case MOUSE_X2MB_DBLCLK:
- command = m_X2DoubleClickAction;
- break;
- }
-
+}
-
std::wstring CMouse::GetActionCommand(MOUSEACTION action) const
{
std::wstring command = m_MouseActions[action];
@@ -319,21 +230,19 @@ void CMouse::ReplaceMouseVariables(std::wstring& result) const
{
loop = false;
}
-std::wstring CMouse::GetMouseVariable(std::wstring variable) const
+ }
while (loop);
- std::wstring result = L"";
+}
std::wstring CMouse::GetMouseVariable(const std::wstring& variable) const
{
std::wstring result;
- CMeter* meter = m_MeterWindow->GetMeter(m_MeterName);
-
POINT pt;
- double xOffset = (double)(m_MeterWindow->GetX() + (meter ? meter->GetX() : 0) - 1);
+ GetCursorPos(&pt);
if (_wcsnicmp(variable.c_str(), L"MOUSEX", 6) == 0)
- xOffset = ((pt.x - xOffset) / (meter ? meter->GetW() : m_MeterWindow->GetW())) * 100;
+ {
double xOffset = (double)(m_MeterWindow->GetX() + (m_Meter ? m_Meter->GetX() : 0) - 1);
if (_wcsicmp(variable.c_str(), L"MOUSEX:%") == 0)
{
@@ -343,10 +252,10 @@ std::wstring CMouse::GetMouseVariable(std::wstring variable) const
else
{
result = std::to_wstring((long)(pt.x - xOffset));
- double yOffset = (double)(m_MeterWindow->GetY() + (meter ? meter->GetY() : 0) - 1);
+ }
}
else if (_wcsnicmp(variable.c_str(), L"MOUSEY", 6) == 0)
- yOffset = ((pt.y - yOffset) / (meter ? meter->GetH() : m_MeterWindow->GetH())) * 100;
+ {
double yOffset = (double)(m_MeterWindow->GetY() + (m_Meter ? m_Meter->GetY() : 0) - 1);
if (_wcsicmp(variable.c_str(), L"MOUSEY:%") == 0)
{
View
140 Library/Mouse.h
@@ -21,27 +21,31 @@
enum MOUSEACTION
{
+ MOUSE_LMB_UP = 0,
MOUSE_LMB_DOWN,
- MOUSE_LMB_UP,
MOUSE_LMB_DBLCLK,
- MOUSE_RMB_DOWN,
- MOUSE_RMB_UP,
- MOUSE_RMB_DBLCLK,
- MOUSE_MMB_DOWN,
MOUSE_MMB_UP,
+ MOUSE_MMB_DOWN,
MOUSE_MMB_DBLCLK,
- MOUSE_OVER,
- MOUSE_LEAVE,
- MOUSE_MW_DOWN,
- MOUSE_MW_UP,
- MOUSE_MW_LEFT,
- MOUSE_MW_RIGHT,
- MOUSE_X1MB_DOWN,
+ MOUSE_RMB_UP,
+ MOUSE_RMB_DOWN,
+ MOUSE_RMB_DBLCLK,
MOUSE_X1MB_UP,
+ MOUSE_X1MB_DOWN,
MOUSE_X1MB_DBLCLK,
- MOUSE_X2MB_DOWN,
MOUSE_X2MB_UP,
- MOUSE_X2MB_DBLCLK
+ MOUSE_X2MB_DOWN,
+ MOUSE_X2MB_DBLCLK,
+
+ MOUSE_MW_UP,
+ MOUSE_MW_DOWN,
+ MOUSE_MW_LEFT,
+ MOUSE_MW_RIGHT,
+
+ MOUSE_OVER,
+ MOUSE_LEAVE,
+
+ MOUSEACTION_COUNT
};
enum MOUSECURSOR
@@ -59,73 +63,87 @@ enum MOUSECURSOR
class CMouse
{
public:
- CMouse();
+ CMouse(CMeterWindow* meterWindow, CMeter* meter = NULL);
~CMouse();
- void ReadOptions(CConfigParser& parser, const WCHAR* section, CMeterWindow* meterWindow);
+ void ReadOptions(CConfigParser& parser, const WCHAR* section);
MOUSECURSOR GetCursorType() const { return m_CursorType; }
HCURSOR GetCursor() const;
bool GetCursorState() const {return m_CursorState; }
void DestroyCustomCursor();
+ bool HasActionCommand(MOUSEACTION action) const { return !m_MouseActions[action].empty(); }
std::wstring GetActionCommand(MOUSEACTION action) const;
- const std::wstring& GetRightDownAction() const { return m_RightDownAction; }
- const std::wstring& GetRightUpAction() const { return m_RightUpAction; }
- const std::wstring& GetRightDoubleClickAction() const { return m_RightDoubleClickAction; }
- const std::wstring& GetLeftDownAction() const { return m_LeftDownAction; }
- const std::wstring& GetLeftUpAction() const { return m_LeftUpAction; }
- const std::wstring& GetLeftDoubleClickAction() const { return m_LeftDoubleClickAction; }
- const std::wstring& GetMiddleDownAction() const { return m_MiddleDownAction; }
- const std::wstring& GetMiddleUpAction() const { return m_MiddleUpAction; }
- const std::wstring& GetMiddleDoubleClickAction() const { return m_MiddleDoubleClickAction; }
- const std::wstring& GetOverAction() const { return m_OverAction; }
- const std::wstring& GetLeaveAction() const { return m_LeaveAction; }
- const std::wstring& GetMouseScrollUpAction() const { return m_MouseScrollUpAction; }
- const std::wstring& GetMouseScrollDownAction() const { return m_MouseScrollDownAction; }
- const std::wstring& GetMouseScrollLeftAction() const { return m_MouseScrollLeftAction; }
- const std::wstring& GetMouseScrollRightAction() const { return m_MouseScrollRightAction; }
- const std::wstring& GetX1DownAction() const { return m_X1DownAction; }
- const std::wstring& GetX1UpAction() const { return m_X1UpAction; }
- const std::wstring& GetX1DoubleClickAction() const { return m_X1DoubleClickAction; }
- const std::wstring& GetX2DownAction() const { return m_X2DownAction; }
- const std::wstring& GetX2UpAction() const { return m_X2UpAction; }
- const std::wstring& GetX2DoubleClickAction() const { return m_X2DoubleClickAction; }
+ bool HasButtonAction() const
+ {
+ return !(
+ GetLeftUpAction().empty() &&
+ GetLeftDownAction().empty() &&
+ GetLeftDoubleClickAction().empty() &&
+ GetMiddleUpAction().empty() &&
+ GetMiddleDownAction().empty() &&
+ GetMiddleDoubleClickAction().empty() &&
+ GetRightUpAction().empty() &&
+ GetRightDownAction().empty() &&
+ GetRightDoubleClickAction().empty() &&
+ GetX1UpAction().empty() &&
+ GetX1DownAction().empty() &&
+ GetX1DoubleClickAction().empty() &&
+ GetX2UpAction().empty() &&
+ GetX2DownAction().empty() &&
+ GetX2DoubleClickAction().empty()
+ );
+ }
+
+ bool HasScrollAction() const
+ {
+ return !(
+ GetMouseScrollUpAction().empty() &&
+ GetMouseScrollDownAction().empty() &&
+ GetMouseScrollLeftAction().empty() &&
+ GetMouseScrollRightAction().empty()
+ );
+ }
+
+ const std::wstring& GetLeftUpAction() const { return m_MouseActions[MOUSE_LMB_UP]; }
+ const std::wstring& GetLeftDownAction() const { return m_MouseActions[MOUSE_LMB_DOWN]; }
+ const std::wstring& GetLeftDoubleClickAction() const { return m_MouseActions[MOUSE_LMB_DBLCLK]; }
+ const std::wstring& GetMiddleUpAction() const { return m_MouseActions[MOUSE_MMB_UP]; }
+ const std::wstring& GetMiddleDownAction() const { return m_MouseActions[MOUSE_MMB_DOWN]; }
+ const std::wstring& GetMiddleDoubleClickAction() const { return m_MouseActions[MOUSE_MMB_DBLCLK]; }
+ const std::wstring& GetRightUpAction() const { return m_MouseActions[MOUSE_RMB_UP]; }
+ const std::wstring& GetRightDownAction() const { return m_MouseActions[MOUSE_RMB_DOWN]; }
+ const std::wstring& GetRightDoubleClickAction() const { return m_MouseActions[MOUSE_RMB_DBLCLK]; }
+ const std::wstring& GetX1UpAction() const { return m_MouseActions[MOUSE_X1MB_UP]; }
+ const std::wstring& GetX1DownAction() const { return m_MouseActions[MOUSE_X1MB_DOWN]; }
+ const std::wstring& GetX1DoubleClickAction() const { return m_MouseActions[MOUSE_X1MB_DBLCLK]; }
+ const std::wstring& GetX2UpAction() const { return m_MouseActions[MOUSE_X2MB_UP]; }
+ const std::wstring& GetX2DownAction() const { return m_MouseActions[MOUSE_X2MB_DOWN]; }
+ const std::wstring& GetX2DoubleClickAction() const { return m_MouseActions[MOUSE_X2MB_DBLCLK]; }
+
+ const std::wstring& GetMouseScrollUpAction() const { return m_MouseActions[MOUSE_MW_UP]; }
+ const std::wstring& GetMouseScrollDownAction() const { return m_MouseActions[MOUSE_MW_DOWN]; }
+ const std::wstring& GetMouseScrollLeftAction() const { return m_MouseActions[MOUSE_MW_LEFT]; }
+ const std::wstring& GetMouseScrollRightAction() const { return m_MouseActions[MOUSE_MW_RIGHT]; }
+
+ const std::wstring& GetOverAction() const { return m_MouseActions[MOUSE_OVER]; }
+ const std::wstring& GetLeaveAction() const { return m_MouseActions[MOUSE_LEAVE]; }
private:
void ReplaceMouseVariables(std::wstring& result) const;
- std::wstring GetMouseVariable(std::wstring variable) const;
-
- std::wstring m_LeftDownAction;
- std::wstring m_RightDownAction;
- std::wstring m_MiddleDownAction;
- std::wstring m_LeftUpAction;
- std::wstring m_RightUpAction;
- std::wstring m_MiddleUpAction;
- std::wstring m_LeftDoubleClickAction;
- std::wstring m_RightDoubleClickAction;
- std::wstring m_MiddleDoubleClickAction;
- std::wstring m_OverAction;
- std::wstring m_LeaveAction;
- std::wstring m_MouseScrollDownAction;
- std::wstring m_MouseScrollUpAction;
- std::wstring m_MouseScrollLeftAction;
- std::wstring m_MouseScrollRightAction;
- std::wstring m_X1DownAction;
- std::wstring m_X1UpAction;
- std::wstring m_X1DoubleClickAction;
- std::wstring m_X2DownAction;
- std::wstring m_X2UpAction;
- std::wstring m_X2DoubleClickAction;
+ std::wstring GetMouseVariable(const std::wstring& variable) const;
+
+ std::wstring m_MouseActions[MOUSEACTION_COUNT];
MOUSECURSOR m_CursorType;
HCURSOR m_CustomCursor;
bool m_CursorState;
CMeterWindow* m_MeterWindow;
- std::wstring m_MeterName;
+ CMeter* m_Meter;
};
#endif

0 comments on commit 9375b50

Please sign in to comment.