// PropertiesPaneView.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù. // #include "stdafx.h" #include "EtActionTool.h" #include "PropertiesPaneView.h" #include "EventPaneView.h" #include "ActionBase.h" #include "UserMessage.h" #include "ActionSignal.h" #include "SignalCustomRender.h" #include "GlobalValue.h" #ifdef _CHECK_CUSTOMFLY #include "MainFrm.h" #include "PaneDefine.h" #endif // CPropertiesPaneView IMPLEMENT_DYNCREATE(CPropertiesPaneView, CFormView) CPropertiesPaneView::CPropertiesPaneView() : CFormView(CPropertiesPaneView::IDD) { m_bActivate = false; m_pObject = NULL; #ifdef _CHECK_CUSTOMFLY m_bNoAccessRefreshState = false; #endif } CPropertiesPaneView::~CPropertiesPaneView() { } void CPropertiesPaneView::DoDataExchange(CDataExchange* pDX) { CFormView::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CPropertiesPaneView, CFormView) ON_WM_SIZE() ON_MESSAGE( UM_REFRESH_PANE, OnRefresh ) ON_MESSAGE( XTPWM_PROPERTYGRID_NOTIFY, OnNotifyGrid ) ON_MESSAGE( UM_PROPERTY_PANE_SET_READONLY, OnSetReadOnly ) ON_MESSAGE( UM_PROPERTY_PANE_SET_MODIFY, OnSetModify ) ON_MESSAGE( UM_PROPERTY_PANE_CHECK_STATE, OnCheckState ) END_MESSAGE_MAP() // CPropertiesPaneView Áø´ÜÀÔ´Ï´Ù. #ifdef _DEBUG void CPropertiesPaneView::AssertValid() const { CFormView::AssertValid(); } #ifndef _WIN32_WCE void CPropertiesPaneView::Dump(CDumpContext& dc) const { CFormView::Dump(dc); } #endif #endif //_DEBUG // CPropertiesPaneView ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. void CPropertiesPaneView::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(184, 177, 205), 0, RGB(182, 210, 189), RGB(247, 243, 233), 0); } void CPropertiesPaneView::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 CPropertiesPaneView::EnableControl( bool bEnable ) { m_PropertyGrid.EnableWindow( bEnable ); ResetPropertyGrid(); } LRESULT CPropertiesPaneView::OnRefresh( WPARAM wParam, LPARAM lParam ) { ResetPropertyGrid(); m_pObject = (CActionBase *)lParam; if( m_pObject == NULL ) { m_pObject = CGlobalValue::GetInstance().GetGlobalObject(); // EnableControl( false ); // return S_OK; } EnableControl( TRUE ); std::vector *pVecList = m_pObject->GetPropertyList(); RefreshPropertyGrid( pVecList ); char szStr[2048] = { 0, }; GetRegistryString( HKEY_CURRENT_USER, REG_SUBKEY, "ResourceFolder", szStr, 2048 ); SetInitDirectory( szStr ); return S_OK; } #ifdef _CHECK_CUSTOMFLY bool CPropertiesPaneView::CheckCustomSignal_Fly() const { const std::vector* pPropertyList = m_pObject->GetPropertyList(); if (pPropertyList == NULL) return true; bool bCustomFly2 = false, bCustomFly = false; std::vector::const_iterator propertyIter = pPropertyList->begin(); for (; propertyIter != pPropertyList->end(); ++propertyIter) { const CUnionValueProperty* pPropertyVar = (*propertyIter); if (pPropertyVar) { const char* pCurrentCategory = pPropertyVar->GetCategory(); if (strcmp(pCurrentCategory, "CustomState") == 0) { const CString& valueString = pPropertyVar->GetBindStr(); if (valueString.CompareNoCase("Custom_Fly2") == 0) bCustomFly2 = true; else if (valueString.CompareNoCase("Custom_Fly") == 0) bCustomFly = true; if (bCustomFly2 && bCustomFly) return true; } } } if (bCustomFly2 && (bCustomFly == false)) { int nID = ::MessageBox( CGlobalValue::GetInstance().GetView()->m_hWnd, "State¿¡ Custom_Fly °ªÀ» ¼³Á¤ÇØ ÁÖ¼¼¿ä!\n\n(Custom_Fly2 °ªÀÌ ¼³Á¤µÇ¸é Custom_Fly °ªÀÌ ¹Ýµå½Ã ÀÖ¾î¾ßÇÕ´Ï´Ù.)", "¿¡·¯", MB_OK ); CWnd* pWnd = GetPaneWnd( EVENT_PANE ); if( pWnd ) pWnd->SendMessage( WM_LBUTTONUP ); return false; } return true; } #endif LRESULT CPropertiesPaneView::OnNotifyGrid( WPARAM wParam, LPARAM lParam ) { return ProcessNotifyGrid( wParam, lParam ); } void CPropertiesPaneView::OnSetValue( CUnionValueProperty *pVariable, DWORD dwIndex ) { if( m_pObject ) m_pObject->OnSetPropertyValue( dwIndex, pVariable ); } void CPropertiesPaneView::OnChangeValue( CUnionValueProperty *pVariable, DWORD dwIndex ) { if( m_pObject ) m_pObject->OnChangePropertyValue( dwIndex, pVariable ); CWnd * pWnd = GetPaneWnd( EVENT_PANE ); CEventPaneView * pEventPaneView = dynamic_cast(pWnd); if( pWnd ) { pEventPaneView->ChangeValueSelectedArraySignal( pVariable, dwIndex ); // ---- ½Ã±×³Î ±æÀ̺¯°æÀº ÇÏÁö¾Êµµ·Ï ÇÑ´Ù. // ÀÌÀ¯´Â ½Ã±×³ÎÀÌ Á¾·áµÈ ÀÌÈÄ¿¡µµ Ä«¸Þ¶ó´Â keyframe ¸¸Å­ °è¼Ó Àû¿ëµÉ °ÍÀ̰í, // Ä«¸Þ¶ó Keyframe ÀÌ ElementÀÇ ÃÖ´ë±æÀ̸¦ ³Ñ¾î°¡´Â °æ¿ì°¡ ¸¹±â ¶§¹®ÀÌ´Ù. // ---- // .cam µ¥ÀÌŸ¸¦ Àоîµé¿© Ä«¸Þ¶óKeyFrame±æÀ̸¸Å­ SignalÀÇ EndFrame À» ¼³Á¤ÇÑ´Ù. //pEventPaneView->ChangeValueSelectedSignal( pVariable, dwIndex ); // bintitle. } } void CPropertiesPaneView::OnSelectChangeValue( CUnionValueProperty *pVariable, DWORD dwIndex ) { if( m_pObject ) m_pObject->OnSelectChangePropertyValue( dwIndex, pVariable ); } LRESULT CPropertiesPaneView::OnSetReadOnly( WPARAM wParam, LPARAM lParam ) { SetReadOnly( (DWORD)wParam, lParam == 0 ? false : true ); return S_OK; } LRESULT CPropertiesPaneView::OnSetModify( WPARAM wParam, LPARAM lParam ) { CUnionValueProperty *pVariable = (CUnionValueProperty *)lParam; if( lParam == NULL ) ModifyItem( wParam, (LPARAM)m_pVecVariable[wParam] ); else ModifyItem( wParam, (LPARAM)lParam ); return S_OK; } LRESULT CPropertiesPaneView::OnCheckState( WPARAM wParam, LPARAM lParam ) { #ifdef _CHECK_CUSTOMFLY if (CheckCustomSignal_Fly() == false) return S_FALSE; #endif return S_OK; }