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

79 lines
1.4 KiB
C
Raw Normal View History

#pragma once
2022-09-26 02:31:54 +00:00
enum
{
CIN_SPECIALKEY
};
typedef struct
{
NMHDR nmh;
2022-09-26 02:31:54 +00:00
int vkey;
} NMCISPECIALKEY;
class CEditConInput : public CWindowImpl<CEditConInput, CEdit>
{
public:
CEditConInput()
{
}
2022-09-26 02:31:54 +00:00
LRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL & bHandled)
{
NMCISPECIALKEY nmsk;
switch (wParam)
{
case VK_UP:
case VK_DOWN:
case VK_RETURN:
2022-09-26 02:31:54 +00:00
nmsk = {{m_hWnd, (UINT_PTR)GetDlgCtrlID(), CIN_SPECIALKEY}, (int)wParam};
SendMessage(GetParent(), WM_NOTIFY, nmsk.nmh.idFrom, (LPARAM)&nmsk);
break;
}
bHandled = FALSE;
return 0;
}
BOOL Attach(HWND hWndNew)
{
return SubclassWindow(hWndNew);
}
BEGIN_MSG_MAP_EX(CEditEval)
2022-09-26 02:31:54 +00:00
{
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown);
}
END_MSG_MAP()
};
class CEditConOutput : public CWindowImpl<CEditConOutput, CEdit>
{
private:
2022-09-26 02:31:54 +00:00
LRESULT OnKeyDown(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL & /*bHandled*/)
{
if (GetKeyState(VK_CONTROL) < 0)
{
if (wParam == 'A')
{
this->SetSelAll();
}
}
return FALSE;
}
2022-09-26 02:31:54 +00:00
public:
BOOL Attach(HWND hWndNew)
{
return SubclassWindow(hWndNew);
}
BEGIN_MSG_MAP_EX(CEditEval)
2022-09-26 02:31:54 +00:00
{
MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown);
}
END_MSG_MAP()
};