// PropShaderPaneView.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù. // #include "stdafx.h" #include "EtViewer.h" #include "PropShaderPaneView.h" #include "UserMessage.h" #include "ObjectBase.h" #include "../MFCUtility/Common.h" // CPropShaderPaneView IMPLEMENT_DYNCREATE(CPropShaderPaneView, CFormView) CPropShaderPaneView::CPropShaderPaneView() : CFormView(CPropShaderPaneView::IDD) { m_bActivate = false; } CPropShaderPaneView::~CPropShaderPaneView() { } void CPropShaderPaneView::DoDataExchange(CDataExchange* pDX) { CFormView::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CPropShaderPaneView, CFormView) ON_WM_SIZE() ON_MESSAGE( UM_SHADERPROP_REFRESH, OnRefresh ) ON_MESSAGE( XTPWM_PROPERTYGRID_NOTIFY, OnNotifyGrid ) ON_MESSAGE( UM_SHADERPROP_MODIFY_ITEM, OnModifyItem ) ON_MESSAGE( UM_PROPERTYGRID_ONCUSTOM_DIALOG, OnCustomDialogGrid ) END_MESSAGE_MAP() // CPropShaderPaneView Áø´ÜÀÔ´Ï´Ù. #ifdef _DEBUG void CPropShaderPaneView::AssertValid() const { CFormView::AssertValid(); } #ifndef _WIN32_WCE void CPropShaderPaneView::Dump(CDumpContext& dc) const { CFormView::Dump(dc); } #endif #endif //_DEBUG // CPropShaderPaneView ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. void CPropShaderPaneView::OnInitialUpdate() { CFormView::OnInitialUpdate(); // TODO: ¿©±â¿¡ Ư¼öÈ­µÈ Äڵ带 Ãß°¡ ¹×/¶Ç´Â ±âº» Ŭ·¡½º¸¦ È£ÃâÇÕ´Ï´Ù. if( m_bActivate == true ) return; m_bActivate = true; CRect rcRect; GetClientRect( &rcRect ); m_PropertyGrid.Create( rcRect, this, 0 ); m_PropertyGrid.SetCustomColors( RGB(200, 200, 200), 0, RGB(182, 210, 189), RGB(247, 243, 233), 0); } void CPropShaderPaneView::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy); // TODO: ¿©±â¿¡ ¸Þ½ÃÁö 󸮱â Äڵ带 Ãß°¡ÇÕ´Ï´Ù. if( m_PropertyGrid ) { CRect rcRect; GetClientRect( &rcRect ); m_PropertyGrid.MoveWindow( &rcRect ); } } void CPropShaderPaneView::EnableControl( bool bEnable ) { m_PropertyGrid.EnableWindow( bEnable ); ResetPropertyGrid(); } LRESULT CPropShaderPaneView::OnRefresh( WPARAM wParam, LPARAM lParam ) { CObjectBase *pTemp = m_pObject; m_pObject = (CObjectBase *)wParam; if( m_pObject == NULL ) { EnableControl( false ); return S_OK; } EnableControl( TRUE ); std::vector *pVecList = m_pObject->GetPropertyList(); RefreshPropertyGrid( pVecList ); return S_OK; } LRESULT CPropShaderPaneView::OnNotifyGrid( WPARAM wParam, LPARAM lParam ) { return ProcessNotifyGrid( wParam, lParam ); } void CPropShaderPaneView::OnSetValue( CUnionValueProperty *pVariable, DWORD dwIndex ) { if( !m_pObject ) return; m_pObject->OnSetPropertyValue( dwIndex, pVariable ); } void CPropShaderPaneView::OnChangeValue( CUnionValueProperty *pVariable, DWORD dwIndex ) { if( !m_pObject ) return; m_pObject->OnChangePropertyValue( dwIndex, pVariable ); } void CPropShaderPaneView::OnSelectChangeValue( CUnionValueProperty *pVariable, DWORD dwIndex ) { if( !m_pObject ) return; m_pObject->OnSelectChangePropertyValue( dwIndex, pVariable ); } void CPropShaderPaneView::OnCustomDialogValue( CUnionValueProperty *pVariable, DWORD dwIndex ) { if( !m_pObject ) return; } LRESULT CPropShaderPaneView::OnModifyItem( WPARAM wParam, LPARAM lParam ) { ModifyItem( wParam, lParam ); return S_OK; } LRESULT CPropShaderPaneView::OnCustomDialogGrid( WPARAM wParam, LPARAM lParam ) { return ProcessCustomDialogGrid( wParam, lParam ); }