diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
commit | c0c336500955a23e344651e5412c9d9d441ef4ee (patch) | |
tree | 790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2SearchDialog.cpp | |
parent | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff) | |
download | t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip |
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2SearchDialog.cpp | 120 |
1 files changed, 118 insertions, 2 deletions
diff --git a/src/T2DLL/T2SearchDialog.cpp b/src/T2DLL/T2SearchDialog.cpp index 2c37751..5a5bd84 100644 --- a/src/T2DLL/T2SearchDialog.cpp +++ b/src/T2DLL/T2SearchDialog.cpp @@ -1,10 +1,126 @@ +#include "GlobalFunc.h" +#include "MoverSearchDlg.h" +#include "PeopleSearchDlg.h" +#include "T2BitImage.h" +#include "T2DlgItem.h" +#include "T2ImageObj.h" #include "T2SearchDialog.h" +#include "T2TowerDoc.h" +#include "TenantSearchDlg.h" -T2SearchDialog::T2SearchDialog(T2TowerDoc*) { +T2SearchDialog::T2SearchDialog(T2TowerDoc* inDoc) { + mDocument = inDoc; + + CRect theRect; + AfxGetMainWnd()->GetWindowRect(theRect); + + HMODULE moduleHandle = GetWorldModuleHandle(); + + mImageObj = new T2ImageObj; + mImage = new T2BitImage(moduleHandle, 7100, true); +#line 24 + _ASSERT(mImage != NULL); + mImageObj->AddObject(moduleHandle, 7100, mImage); + + T2DLGTEMPLATE theTemplate; + theTemplate.pt = theRect.CenterPoint(); + theTemplate.moduleHandle = moduleHandle; + theTemplate.resID = 7100; + Realize(mDocument, &theTemplate, mDocument, mImageObj, NULL, true, NULL, 0, true); + + mPeopleSearchDlg = new PeopleSearchDlg; + mTenantSearchDlg = new TenantSearchDlg; + mMoverSearchDlg = new MoverSearchDlg; + + POINT pt; + pt.x = 152; + pt.y = 128; + mPeopleSearchDlg->Create(mTowerDoc, moduleHandle, this, pt); + mTenantSearchDlg->Create(mTowerDoc, moduleHandle, this, pt); + mMoverSearchDlg->Create(mTowerDoc, moduleHandle, this, pt); + mPeopleSearchDlg->ShowWindow(SW_SHOW); + + T2DlgItem *thePeopleCheckBox = GetT2DlgItem(104); + thePeopleCheckBox->SetValue(1); + + m108 = 1; } /*virtual*/ T2SearchDialog::~T2SearchDialog() { + if (mImageObj) + delete mImageObj; + if (mImage) + delete mImage; } -/*virtual*/ int T2SearchDialog::OnT2DialogCommand(unsigned int, long) { +/*virtual*/ BOOL T2SearchDialog::OnT2DialogCommand(WPARAM inWParam, LPARAM inLParam) { + BOOL res = true; + + T2DlgItem *theCheck1 = GetT2DlgItem(104); + T2DlgItem *theCheck2 = GetT2DlgItem(105); + T2DlgItem *theCheck3 = GetT2DlgItem(106); + + WORD code = HIWORD(inWParam); + WORD id = LOWORD(inWParam); + + switch (id) { + case 104: + mPeopleSearchDlg->ShowWindow(SW_SHOW); + mTenantSearchDlg->ShowWindow(SW_HIDE); + mMoverSearchDlg->ShowWindow(SW_HIDE); + theCheck2->SetValue(0); + theCheck3->SetValue(0); + m108 = 1; + break; + case 105: + mPeopleSearchDlg->ShowWindow(SW_HIDE); + mTenantSearchDlg->ShowWindow(SW_SHOW); + mMoverSearchDlg->ShowWindow(SW_HIDE); + theCheck1->SetValue(0); + theCheck3->SetValue(0); + m108 = 2; + break; + case 106: + mPeopleSearchDlg->ShowWindow(SW_HIDE); + mTenantSearchDlg->ShowWindow(SW_HIDE); + mMoverSearchDlg->ShowWindow(SW_SHOW); + theCheck1->SetValue(0); + theCheck2->SetValue(0); + m108 = 3; + break; + case 107: + switch (m108) { + case 1: + mPeopleSearchDlg->DoDelete(); + break; + case 2: + mTenantSearchDlg->DoDelete(); + break; + case 3: + mMoverSearchDlg->DoDelete(); + break; + } + break; + case 108: + ShowWindow(SW_HIDE); + switch (m108) { + case 1: + mPeopleSearchDlg->DoFind(); + break; + case 2: + mTenantSearchDlg->DoFind(); + break; + case 3: + mMoverSearchDlg->DoFind(); + break; + } + case 109: + OnT2OK(); + DoClose(id); + break; + default: + res = T2Dialog::OnT2DialogCommand(inWParam, inLParam); + } + + return res; } |