aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/XUI/XUI_SignEntry.h
blob: 4f8c44d268bbd32233bd1d26f2fbe12e35a73f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "../media/xuiscene_signentry.h"
#include "XUI_Ctrl_4JEdit.h"
#include "XUI_CustomMessages.h"

#define SIGN_ENTRY_ROWS_MAX 4

class SignTileEntity;

class CScene_SignEntry : public CXuiSceneImpl
{
	protected:
	// Control and Element wrapper objects.
	CXuiCtrl4JEdit m_signRows[4];
	CXuiControl m_ButtonDone;
	CXuiControl m_labelEditSign;

	// Message map. Here we tie messages to message handlers.
	XUI_BEGIN_MSG_MAP()
		XUI_ON_XM_INIT( OnInit )
		XUI_ON_XM_NOTIFY_PRESS_EX(OnNotifyPressEx)
		XUI_ON_XM_KEYDOWN(OnKeyDown)
	XUI_END_MSG_MAP()

	// Control mapping to objects
	BEGIN_CONTROL_MAP()
		MAP_CONTROL(IDC_EditSignMessage, m_labelEditSign)
		MAP_CONTROL(IDC_ButtonDone, m_ButtonDone)
		MAP_CONTROL(IDC_EditLineOne, m_signRows[0])
		MAP_CONTROL(IDC_EditLineTwo, m_signRows[1])
		MAP_CONTROL(IDC_EditLineThree, m_signRows[2])
		MAP_CONTROL(IDC_EditLineFour, m_signRows[3])
	END_CONTROL_MAP()

	HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled );
	HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled);
	HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled);

public:

	// Define the class. The class name must match the ClassOverride property
	// set for the scene in the UI Authoring tool.
	XUI_IMPLEMENT_CLASS( CScene_SignEntry, L"CScene_SignEntry", XUI_CLASS_SCENE )

private:
	shared_ptr<SignTileEntity> m_sign;
	D3DXVECTOR3 m_OriginalPosition;

};