#include "CEditWFocus.h" #include "T2Dialog.h" #include "T2DlgItemMerchandiseField.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif T2DlgItemMerchandiseField::T2DlgItemMerchandiseField(T2TowerDoc *inDoc, T2ImageObj *inImageObj, CPalette *inPalette) : T2DlgItemEdit(inDoc, inImageObj, inPalette) { } /*virtual*/ T2DlgItemMerchandiseField::~T2DlgItemMerchandiseField() { } /*virtual*/ void T2DlgItemMerchandiseField::CreateSubItem(void *inData) { T2DlgItemEdit::CreateSubItem(inData); if (mSubItem) mSubItem->SetReadOnly(); } /*virtual*/ void T2DlgItemMerchandiseField::OnT2SetFocus(CWnd *inWnd) { T2DlgItemEdit::OnT2SetFocus(inWnd); T2DlgItem *theField1 = ((T2Dialog *) GetParent())->GetT2DlgItem(GetDlgCtrlID() + 1); if (theField1) { theField1->SetValue(GetValue()); theField1->ShowWindow(SW_SHOWNORMAL); } T2DlgItem *theField2 = ((T2Dialog *) GetParent())->GetT2DlgItem(GetDlgCtrlID() + 2); if (theField2) theField2->ShowWindow(SW_HIDE); } /*virtual*/ void T2DlgItemMerchandiseField::OnT2KillFocus(CWnd *inWnd) { T2DlgItemEdit::OnT2KillFocus(inWnd); T2DlgItem *theField1 = ((T2Dialog *) GetParent())->GetT2DlgItem(GetDlgCtrlID() + 1); if (theField1) theField1->ShowWindow(SW_HIDE); T2DlgItem *theField2 = ((T2Dialog *) GetParent())->GetT2DlgItem(GetDlgCtrlID() + 2); if (theField2) theField2->ShowWindow(SW_SHOWNORMAL); }