Skip to content

Commit

Permalink
Mouse: Added various cursor options
Browse files Browse the repository at this point in the history
  • Loading branch information
brianferguson committed Feb 25, 2022
1 parent 55e4da2 commit 114a9c7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
64 changes: 64 additions & 0 deletions Library/Mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,38 @@ void Mouse::ReadOptions(ConfigParser& parser, const WCHAR* section)
{
m_CursorType = MOUSECURSOR_PEN;
}
else if (_wcsicmp(mouseCursor, L"NO") == 0)
{
m_CursorType = MOUSECURSOR_NO;
}
else if (_wcsicmp(mouseCursor, L"SIZE_ALL") == 0)
{
m_CursorType = MOUSECURSOR_SIZE_ALL;
}
else if (_wcsicmp(mouseCursor, L"SIZE_NESW") == 0)
{
m_CursorType = MOUSECURSOR_SIZE_NESW;
}
else if (_wcsicmp(mouseCursor, L"SIZE_NS") == 0)
{
m_CursorType = MOUSECURSOR_SIZE_NS;
}
else if (_wcsicmp(mouseCursor, L"SIZE_NWSE") == 0)
{
m_CursorType = MOUSECURSOR_SIZE_NWSE;
}
else if (_wcsicmp(mouseCursor, L"SIZE_WE") == 0)
{
m_CursorType = MOUSECURSOR_SIZE_WE;
}
else if (_wcsicmp(mouseCursor, L"UPARROW") == 0)
{
m_CursorType = MOUSECURSOR_UPARROW;
}
else if (_wcsicmp(mouseCursor, L"WAIT") == 0)
{
m_CursorType = MOUSECURSOR_WAIT;
}
else if (wcschr(mouseCursor, L'.'))
{
m_CursorType = MOUSECURSOR_CUSTOM;
Expand Down Expand Up @@ -173,6 +205,38 @@ HCURSOR Mouse::GetCursor(bool isButton) const
name = MAKEINTRESOURCE(32631);
break;

case MOUSECURSOR_NO:
name = IDC_NO;
break;

case MOUSECURSOR_SIZE_ALL:
name = IDC_SIZEALL;
break;

case MOUSECURSOR_SIZE_NESW:
name = IDC_SIZENESW;
break;

case MOUSECURSOR_SIZE_NS:
name = IDC_SIZENS;
break;

case MOUSECURSOR_SIZE_NWSE:
name = IDC_SIZENWSE;
break;

case MOUSECURSOR_SIZE_WE:
name = IDC_SIZEWE;
break;

case MOUSECURSOR_UPARROW:
name = IDC_UPARROW;
break;

case MOUSECURSOR_WAIT:
name = IDC_WAIT;
break;

case MOUSECURSOR_CUSTOM:
{
if (m_CustomCursor)
Expand Down
8 changes: 8 additions & 0 deletions Library/Mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ enum MOUSECURSOR
MOUSECURSOR_BUSY,
MOUSECURSOR_CROSS,
MOUSECURSOR_PEN,
MOUSECURSOR_NO,
MOUSECURSOR_SIZE_ALL,
MOUSECURSOR_SIZE_NESW,
MOUSECURSOR_SIZE_NS,
MOUSECURSOR_SIZE_NWSE,
MOUSECURSOR_SIZE_WE,
MOUSECURSOR_UPARROW,
MOUSECURSOR_WAIT,
MOUSECURSOR_CUSTOM
};

Expand Down

0 comments on commit 114a9c7

Please sign in to comment.