46 lines
957 B
C++
46 lines
957 B
C++
#ifndef _COMMON_CURSORCONTROL_HPP_
|
|
#define _COMMON_CURSORCONTROL_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
|
|
class CursorControl
|
|
{
|
|
public:
|
|
enum CursorID{Arrow=IDC_ARROW,IBeam=IDC_IBEAM,Wait=IDC_WAIT,Cross=IDC_CROSS,
|
|
UpArrow=IDC_UPARROW,Size=IDC_SIZE,Icon=IDC_ICON,SizeNWSE=IDC_SIZENWSE,
|
|
SizeNESW=IDC_SIZENESW,SizeWE=IDC_SIZEWE,SizeNS=IDC_SIZENS,
|
|
SizeAll=IDC_SIZEALL,No=IDC_NO,AppStarting=IDC_APPSTARTING,Help=IDC_HELP};
|
|
CursorControl(void);
|
|
virtual ~CursorControl();
|
|
void waitCursor(int setState);
|
|
void setCursor(int setState,CursorID cursorID=Wait);
|
|
static int showCursor(BOOL show);
|
|
private:
|
|
HCURSOR mhCursor;
|
|
};
|
|
|
|
inline
|
|
CursorControl::CursorControl(void)
|
|
: mhCursor(0)
|
|
{
|
|
}
|
|
|
|
inline
|
|
CursorControl::~CursorControl()
|
|
{
|
|
waitCursor(FALSE);
|
|
}
|
|
|
|
inline
|
|
void CursorControl::waitCursor(int setState)
|
|
{
|
|
setCursor(setState,Wait);
|
|
}
|
|
|
|
inline
|
|
int CursorControl::showCursor(BOOL show)
|
|
{
|
|
return ::ShowCursor(show);
|
|
}
|
|
#endif |