diff options
Diffstat (limited to 'src/T2DLL/T2SettingDialog.cpp')
-rw-r--r-- | src/T2DLL/T2SettingDialog.cpp | 120 |
1 files changed, 118 insertions, 2 deletions
diff --git a/src/T2DLL/T2SettingDialog.cpp b/src/T2DLL/T2SettingDialog.cpp index ab32382..408b2af 100644 --- a/src/T2DLL/T2SettingDialog.cpp +++ b/src/T2DLL/T2SettingDialog.cpp @@ -1,10 +1,126 @@ +#include "GlobalFunc.h" +#include "SoundDlg.h" +#include "SpeedDlg.h" +#include "T2BitImage.h" +#include "T2DlgItem.h" +#include "T2ImageObj.h" #include "T2SettingDialog.h" +#include "WalkerDlg.h" -T2SettingDialog::T2SettingDialog(T2TowerDoc*) { +T2SettingDialog::T2SettingDialog(T2TowerDoc* inDoc) { + mDocument = inDoc; + + CRect rect; + AfxGetMainWnd()->GetWindowRect(rect); + + HINSTANCE theModule = GetWorldModuleHandle(); + mImageObj = new T2ImageObj; + mBitImage = new T2BitImage(theModule, 7000, true); +#line 24 + _ASSERT(mBitImage != NULL); + mImageObj->AddObject(theModule, 7000, mBitImage); + + T2DLGTEMPLATE tmpl; + tmpl.pt = rect.CenterPoint(); + tmpl.moduleHandle = theModule; + tmpl.resID = 7000; + Realize(mDocument, &tmpl, mDocument, mImageObj, NULL, true, NULL, 0, true); + + mSpeedDlg = new SpeedDlg; + mSoundDlg = new SoundDlg; + mWalkerDlg = new WalkerDlg; + + POINT pt; + pt.x = 70; + pt.y = 30; + mSpeedDlg->Setup(mTowerDoc, theModule, this, pt, mImageObj); + mSoundDlg->Setup(mTowerDoc, theModule, this, pt, mImageObj); + mWalkerDlg->Setup(mTowerDoc, theModule, this, pt, mImageObj); + + mSpeedDlg->ShowWindow(5); + + T2DlgItem *theRadio = GetT2DlgItem(108); + theRadio->SetValue(1); + + T2DlgItem *theText = GetT2DlgItem(120); + CString str; + mSpeedDlg->GetWindowText(str); + theText->SetDescriptor(str); } /*virtual*/ T2SettingDialog::~T2SettingDialog() { + if (mImageObj) + delete mImageObj; + if (mBitImage) + delete mBitImage; } -/*virtual*/ int T2SettingDialog::OnT2DialogCommand(unsigned int, long) { +/*virtual*/ int T2SettingDialog::OnT2DialogCommand(unsigned int cmd, long data) { + int result = 1; + + WORD hi = HIWORD(cmd); + WORD lo = LOWORD(cmd); + + T2DlgItem *theSpeedTabRadio = GetT2DlgItem(108); + T2DlgItem *theSoundTabRadio = GetT2DlgItem(109); + T2DlgItem *theWalkerTabRadio = GetT2DlgItem(110); + T2DlgItem *theText = GetT2DlgItem(120); + + CString str; + + switch (lo) { + case 108: + mSoundDlg->ShowWindow(SW_HIDE); + mWalkerDlg->ShowWindow(SW_HIDE); + mSpeedDlg->ShowWindow(SW_SHOW); + theSoundTabRadio->SetValue(0); + theWalkerTabRadio->SetValue(0); + mSpeedDlg->GetWindowText(str); + theText->SetDescriptor(str); + break; + + case 109: + mWalkerDlg->ShowWindow(SW_HIDE); + mSpeedDlg->ShowWindow(SW_HIDE); + mSoundDlg->ShowWindow(SW_SHOW); + theSpeedTabRadio->SetValue(0); + theWalkerTabRadio->SetValue(0); + mSoundDlg->GetWindowText(str); + theText->SetDescriptor(str); + break; + + case 110: + mSoundDlg->ShowWindow(SW_HIDE); + mSpeedDlg->ShowWindow(SW_HIDE); + mWalkerDlg->ShowWindow(SW_SHOW); + theSpeedTabRadio->SetValue(0); + theSoundTabRadio->SetValue(0); + mWalkerDlg->GetWindowText(str); + theText->SetDescriptor(str); + break; + + case 111: + mSpeedDlg->Revert(); + mSoundDlg->Revert(); + mWalkerDlg->Revert(); + break; + + case 112: + mSpeedDlg->Save(); + mSoundDlg->Save(); + mWalkerDlg->Save(); + OnT2OK(); + DoClose(lo); + break; + + case 113: + OnT2OK(); + DoClose(lo); + break; + + default: + result = T2Dialog::OnT2DialogCommand(cmd, data); + } + + return result; } |