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

56 lines
1.9 KiB
C
Raw Normal View History

2016-01-27 09:11:59 +00:00
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
#include <wtl/atlctrls.h>
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);
void SetValue(uint32_t Value, bool ShowHexIdent = true, bool ZeroExtend = false);
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
};