-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPropertiesWnd.cpp
87 lines (70 loc) · 1.92 KB
/
PropertiesWnd.cpp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "stdafx.h"
#include "PropertiesWnd.h"
#include "Resource.h"
#include "MainFrm.h"
#include "SceneEditor.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
/////////////////////////////////////////////////////////////////////////////
// CResourceViewBar
CPropertiesWnd::CPropertiesWnd()
{
}
CPropertiesWnd::~CPropertiesWnd()
{
}
BEGIN_MESSAGE_MAP(CPropertiesWnd, CDockablePane)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_SETFOCUS()
ON_WM_SETTINGCHANGE()
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
void CPropertiesWnd::AdjustLayout()
{
if (GetSafeHwnd() == NULL)
{
return;
}
CRect rectClient;
GetClientRect(rectClient);
m_wndEditTerrain->SetWindowPos(NULL,rectClient.left,rectClient.top,rectClient.Width(),500,SWP_NOACTIVATE | SWP_NOZORDER);
m_wndEditTerrain->updateVScrollRange(rectClient.Height());
UpdateWindow();
}
int CPropertiesWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
m_wndEditTerrain=new EditTerainWnd();
m_wndEditTerrain->Create(IDD_EDIT_TERRAIN,this);
m_wndEditTerrain->ShowWindow(SW_SHOW);
//CRect re;
//GetWindowRect(re);
//re.left=re.left-60; //µ÷Õû´°¿Ú¿í¶È
//MoveWindow(re,TRUE);
AdjustLayout();
return 0;
}
void CPropertiesWnd::OnSize(UINT nType, int cx, int cy)
{
CDockablePane::OnSize(nType, cx, cy);
//µ÷Õû²¼¾Ö//
CRect rectClient;
GetClientRect(rectClient);
m_wndEditTerrain->SetWindowPos(NULL,rectClient.left, rectClient.top,rectClient.Width(),rectClient.Height(),SWP_NOACTIVATE | SWP_NOZORDER);
m_wndEditTerrain->updateVScrollRange(rectClient.Height());
UpdateWindow();
Invalidate(true); //Ç¿ÖÆÖػ洰¿Ú//
}
void CPropertiesWnd::OnSetFocus(CWnd* pOldWnd)
{
CDockablePane::OnSetFocus(pOldWnd);
}
void CPropertiesWnd::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{
CDockablePane::OnSettingChange(uFlags, lpszSection);
}