project64/Source/Project64/UserInterface/WTLControls/EditNumber32.h

48 lines
1.2 KiB
C
Raw Normal View History

2016-01-27 09:11:59 +00:00
#pragma once
#include <wtl/atlctrls.h>
#include "DisplayMode.h"
2016-01-27 09:11:59 +00:00
class CEditNumber32 :
public CWindowImpl<CEditNumber32, CEdit>
2016-01-27 09:11:59 +00:00
{
public:
enum DisplayType
{
DisplayHex,
DisplayDec,
};
2016-01-27 09:11:59 +00:00
CEditNumber32(void);
virtual ~CEditNumber32(void);
BOOL Attach(HWND hWndNew);
BOOL AttachToDlgItem(HWND parent, UINT dlgID);
void SetDisplayType(DisplayType Type);
uint32_t GetValue(void);
stdstr GetValueText(void);
void SetValue(uint32_t Value, DisplayMode Display = DisplayMode::ShowHexIdent);
2016-01-27 09:11:59 +00:00
protected:
enum
{
WM_VALIDATE_VALUE = WM_USER + 0x97
};
2016-01-27 09:11:59 +00:00
DisplayType m_DisplayType;
2016-01-27 09:11:59 +00:00
BEGIN_MSG_MAP(CEditNumber32)
MESSAGE_HANDLER(WM_CHAR, OnKeyDown)
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown)
MESSAGE_HANDLER(WM_PASTE, OnPaste)
MESSAGE_HANDLER(WM_VALIDATE_VALUE, OnValidateValue);
END_MSG_MAP()
2016-01-27 09:11:59 +00:00
bool IsHexConvertableText(LPTSTR _text);
void FormatClipboard();
2016-01-27 09:11:59 +00:00
LRESULT OnValidateValue(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnPaste(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
2016-01-27 09:11:59 +00:00
};