// AKAssmsViewEditSQL.cpp : implementation file
//

#include "stdafx.h"
#include "AKAssms.h"
#include "AKAssmsViewEditSQL.h"
#include "AKAssmsDoc.h"


// CAKAssmsViewEditSQL

IMPLEMENT_DYNCREATE(CAKAssmsViewEditSQL, CEditView)

CAKAssmsViewEditSQL::CAKAssmsViewEditSQL()
{

}

CAKAssmsViewEditSQL::~CAKAssmsViewEditSQL()
{
}

BEGIN_MESSAGE_MAP(CAKAssmsViewEditSQL, CEditView)
END_MESSAGE_MAP()


// CAKAssmsViewEditSQL diagnostics

#ifdef _DEBUG
void CAKAssmsViewEditSQL::AssertValid() const
{
	CEditView::AssertValid();
}

#ifndef _WIN32_WCE
void CAKAssmsViewEditSQL::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}
#endif
#endif //_DEBUG


// CAKAssmsViewEditSQL message handlers


void
CAKAssmsViewEditSQL::OnUpdate ( CView * /*pSender*/, LPARAM lHint, CObject* /*pHint*/ )
{
    // Act according to hint
    switch ( lHint )
    {
      // Document contains SQL to be both loaded and executed
      case 1:
      {
        // Clear all current text
        GetEditCtrl().SetSel ( 0, -1 );
        GetEditCtrl().Clear  ( );
        // Refresh with document text.
        CAKAssmsDoc *pDoc = (CAKAssmsDoc *)GetDocument();
        GetEditCtrl().SetWindowText ( pDoc->GetSQLstmt() );
      }

      //
    }
}
