136 lines
3.4 KiB
C++
136 lines
3.4 KiB
C++
|
|
// GridDescriptionPaneView.cpp : implementation file
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
#include "stdafx.h"
|
|||
|
|
#include "EtWorldPainter.h"
|
|||
|
|
#include "GridDescriptionPaneView.h"
|
|||
|
|
#include "UserMessage.h"
|
|||
|
|
#include "FileServer.h"
|
|||
|
|
#include "TEtWorld.h"
|
|||
|
|
#include "TEtWorldGrid.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
// CGridDescriptionPaneView
|
|||
|
|
|
|||
|
|
IMPLEMENT_DYNCREATE(CGridDescriptionPaneView, CFormView)
|
|||
|
|
|
|||
|
|
CGridDescriptionPaneView::CGridDescriptionPaneView()
|
|||
|
|
: CFormView(CGridDescriptionPaneView::IDD)
|
|||
|
|
{
|
|||
|
|
m_bActivate = false;
|
|||
|
|
m_pGrid = NULL;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CGridDescriptionPaneView::~CGridDescriptionPaneView()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CGridDescriptionPaneView::DoDataExchange(CDataExchange* pDX)
|
|||
|
|
{
|
|||
|
|
CFormView::DoDataExchange(pDX);
|
|||
|
|
DDX_Control(pDX, IDC_RICHEDIT21, m_RichEdit);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
BEGIN_MESSAGE_MAP(CGridDescriptionPaneView, CFormView)
|
|||
|
|
ON_WM_SIZE()
|
|||
|
|
ON_MESSAGE( UM_REFRESH_PANE_VIEW, OnRefresh )
|
|||
|
|
ON_WM_ERASEBKGND()
|
|||
|
|
ON_EN_CHANGE(IDC_RICHEDIT21, &CGridDescriptionPaneView::OnEnChangeRichedit21)
|
|||
|
|
ON_EN_UPDATE(IDC_RICHEDIT21, &CGridDescriptionPaneView::OnEnUpdateRichedit21)
|
|||
|
|
END_MESSAGE_MAP()
|
|||
|
|
|
|||
|
|
|
|||
|
|
// CGridDescriptionPaneView diagnostics
|
|||
|
|
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
void CGridDescriptionPaneView::AssertValid() const
|
|||
|
|
{
|
|||
|
|
CFormView::AssertValid();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#ifndef _WIN32_WCE
|
|||
|
|
void CGridDescriptionPaneView::Dump(CDumpContext& dc) const
|
|||
|
|
{
|
|||
|
|
CFormView::Dump(dc);
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
#endif //_DEBUG
|
|||
|
|
|
|||
|
|
|
|||
|
|
// CGridDescriptionPaneView message handlers
|
|||
|
|
|
|||
|
|
void CGridDescriptionPaneView::OnInitialUpdate()
|
|||
|
|
{
|
|||
|
|
CFormView::OnInitialUpdate();
|
|||
|
|
|
|||
|
|
// TODO: <20><><EFBFBD> Ư<><C6AF>ȭ<EFBFBD><C8AD> <20>ڵ带 <20>߰<EFBFBD> <20><>/<2F>Ǵ<EFBFBD> <20>⺻ Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȣ<><C8A3><EFBFBD>մϴ<D5B4>.
|
|||
|
|
if( m_bActivate == true ) return;
|
|||
|
|
m_bActivate = true;
|
|||
|
|
|
|||
|
|
m_RichEdit.EnableWindow( FALSE );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CGridDescriptionPaneView::OnSize(UINT nType, int cx, int cy)
|
|||
|
|
{
|
|||
|
|
CFormView::OnSize(nType, cx, cy);
|
|||
|
|
|
|||
|
|
// TODO: <20><><EFBFBD> <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
|
|||
|
|
if( m_RichEdit ) {
|
|||
|
|
CRect rcRect;
|
|||
|
|
GetClientRect( &rcRect );
|
|||
|
|
m_RichEdit.MoveWindow( &rcRect );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
LRESULT CGridDescriptionPaneView::OnRefresh( WPARAM wParam, LPARAM lParam )
|
|||
|
|
{
|
|||
|
|
m_RichEdit.SetWindowText( "" );
|
|||
|
|
|
|||
|
|
CString szGridName = CGlobalValue::GetInstance().m_szSelectGrid;
|
|||
|
|
m_pGrid = (CTEtWorldGrid*)CTEtWorld::GetInstance().FindGrid( szGridName );
|
|||
|
|
if( !m_pGrid ) {
|
|||
|
|
m_RichEdit.EnableWindow( FALSE );
|
|||
|
|
return S_OK;
|
|||
|
|
}
|
|||
|
|
m_RichEdit.SetWindowText( m_pGrid->GetDescription() );
|
|||
|
|
|
|||
|
|
szGridName = CGlobalValue::GetInstance().m_szCheckOutGrid;
|
|||
|
|
CTEtWorldGrid *pGrid = (CTEtWorldGrid*)CTEtWorld::GetInstance().FindGrid( szGridName );
|
|||
|
|
m_RichEdit.EnableWindow( ( pGrid ) ? TRUE : FALSE );
|
|||
|
|
|
|||
|
|
Invalidate();
|
|||
|
|
return S_OK;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
BOOL CGridDescriptionPaneView::OnEraseBkgnd(CDC* pDC)
|
|||
|
|
{
|
|||
|
|
// TODO: <20><><EFBFBD> <20><EFBFBD><DEBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD> <20><>/<2F>Ǵ<EFBFBD> <20>⺻<EFBFBD><E2BABB><EFBFBD><EFBFBD> ȣ<><C8A3><EFBFBD>մϴ<D5B4>.
|
|||
|
|
|
|||
|
|
return FALSE;
|
|||
|
|
// return __super::OnEraseBkgnd(pDC);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CGridDescriptionPaneView::OnEnChangeRichedit21()
|
|||
|
|
{
|
|||
|
|
// TODO: If this is a RICHEDIT control, the control will not
|
|||
|
|
// send this notification unless you override the CFormView::OnInitDialog()
|
|||
|
|
// function and call CRichEditCtrl().SetEventMask()
|
|||
|
|
// with the ENM_CHANGE flag ORed into the mask.
|
|||
|
|
|
|||
|
|
// TODO: Add your control notification handler code here
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CGridDescriptionPaneView::OnEnUpdateRichedit21()
|
|||
|
|
{
|
|||
|
|
// TODO: If this is a RICHEDIT control, the control will not
|
|||
|
|
// send this notification unless you override the CFormView::OnInitDialog()
|
|||
|
|
// function to send the EM_SETEVENTMASK message to the control
|
|||
|
|
// with the ENM_UPDATE flag ORed into the lParam mask.
|
|||
|
|
|
|||
|
|
// TODO: Add your control notification handler code here
|
|||
|
|
CString szStr;
|
|||
|
|
m_RichEdit.GetWindowText( szStr );
|
|||
|
|
|
|||
|
|
if( m_pGrid ) m_pGrid->SetDescription( szStr );
|
|||
|
|
}
|