summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2Dialog.cpp653
1 files changed, 598 insertions, 55 deletions
diff --git a/src/T2DLL/T2Dialog.cpp b/src/T2DLL/T2Dialog.cpp
index c00b5d7..f990466 100644
--- a/src/T2DLL/T2Dialog.cpp
+++ b/src/T2DLL/T2Dialog.cpp
@@ -1,5 +1,40 @@
+#include "CToggleButtonDisabled.h"
#include "CTokenizer.h"
+#include "T2AdvertiseTable.h"
#include "T2Dialog.h"
+#include "T2DlgItem.h"
+#include "T2DlgItemAnimation.h"
+#include "T2DlgItemArrows.h"
+#include "T2DlgItemBelongGage.h"
+#include "T2DlgItemBox.h"
+#include "T2DlgItemCANCEL.h"
+#include "T2DlgItemCheck.h"
+#include "T2DlgItemCustomerGage.h"
+#include "T2DlgItemEdit.h"
+#include "T2DlgItemHScr.h"
+#include "T2DlgItemIButton.h"
+#include "T2DlgItemICheck.h"
+#include "T2DlgItemIRepeater.h"
+#include "T2DlgItemImage.h"
+#include "T2DlgItemListBox.h"
+#include "T2DlgItemMerchandiseField.h"
+#include "T2DlgItemMovie.h"
+#include "T2DlgItemOK.h"
+#include "T2DlgItemPPLEvalGage.h"
+#include "T2DlgItemPeopleView.h"
+#include "T2DlgItemPopup.h"
+#include "T2DlgItemProfitsGage.h"
+#include "T2DlgItemProgress.h"
+#include "T2DlgItemRadioButton.h"
+#include "T2DlgItemRadioText.h"
+#include "T2DlgItemSTimeTbl.h"
+#include "T2DlgItemStressGage.h"
+#include "T2DlgItemTButton.h"
+#include "T2DlgItemTable.h"
+#include "T2DlgItemText.h"
+#include "T2DlgItemVScr.h"
+#include "T2MovieTable.h"
+#include "T2PluginInfoTable.h"
#include "T2TowerDoc.h"
#include "T2WorldDef.h"
@@ -9,7 +44,7 @@ T2Dialog::T2Dialog() {
mInModalLoop = false;
mUserCon = 0;
mDeleteOnClose = false;
- mFontName = "�l�r �o�S�V�b�N";
+ mFontName = "\x82\x6C\x82\x72 \x82\x6F\x83\x53\x83\x56\x83\x62\x83\x4E";
for (int i = 0; i < 10; i++)
mFontNums[i] = 0;
@@ -22,10 +57,10 @@ T2Dialog::T2Dialog() {
}
}
-void T2Dialog::Realize(void* a, T2DLGTEMPLATE* tmpl, T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* palette, int b, CWnd* parentWnd, UINT nID, int d) {
+void T2Dialog::Realize(void* a, T2DLGTEMPLATE* tmpl, T2TowerDoc* towerDoc, T2ImageObj* imageObj, CPalette* palette, BOOL isToolWindow, CWnd* parentWnd, UINT nID, BOOL autoShow) {
mEC = a;
mTowerDoc = towerDoc;
- mF4 = d;
+ mAutoShow = autoShow;
mTemplate = *tmpl;
mImageObj = imageObj;
@@ -57,10 +92,10 @@ void T2Dialog::Realize(void* a, T2DLGTEMPLATE* tmpl, T2TowerDoc* towerDoc, T2Ima
NULL);
CreateEx(
- b ? WS_EX_TOOLWINDOW : 0,
+ isToolWindow ? WS_EX_TOOLWINDOW : 0,
wndClass,
"",
- b ? (WS_POPUP | WS_CAPTION) : WS_CHILD,
+ isToolWindow ? (WS_POPUP | WS_CAPTION) : WS_CHILD,
rect,
parentWnd,
nID
@@ -84,28 +119,29 @@ int T2Dialog::OnCreate(CREATESTRUCT* cs) {
HRSRC rsrc = FindResource(mTemplate.moduleHandle, MAKEINTATOM(mTemplate.resID), "T2DLG");
if (!rsrc) {
- MessageBox("�_�C�A���O������܂���B");
+ // "ダイアログがありません。" - No dialog.
+ MessageBox("\x83\x5F\x83\x43\x83\x41\x83\x8D\x83\x4F\x82\xAA\x82\xA0\x82\xE8\x82\xDC\x82\xB9\x82\xF1\x81\x42");
return 0;
}
#line 90
_ASSERT(rsrc);
- HGLOBAL hglobal = LoadResource(mTemplate.moduleHandle, rsrc);
+ HGLOBAL theResHandle = LoadResource(mTemplate.moduleHandle, rsrc);
#line 92
- _ASSERT(hglobal);
+ _ASSERT(theResHandle);
- void *resData = LockResource(hglobal);
+ void *theRes = LockResource(theResHandle);
#line 94
- _ASSERT(resData);
+ _ASSERT(theRes);
- DWORD resSize = SizeofResource(mTemplate.moduleHandle, rsrc);
- char *buffer = (char *) malloc(resSize + 1);
- memcpy(buffer, resData, resSize);
- buffer[resSize] = 0;
+ DWORD theResSize = SizeofResource(mTemplate.moduleHandle, rsrc);
+ char *data = (char *) malloc(theResSize + 1);
+ memcpy(data, theRes, theResSize);
+ data[theResSize] = 0;
- DoOnCreate(buffer);
- free(buffer);
+ DoOnCreate(data);
+ free(data);
OnT2Create();
@@ -116,7 +152,7 @@ int T2Dialog::OnCreate(CREATESTRUCT* cs) {
mTowerDoc->towerDoc_vf290(1);
}
- if (mF4 && !(cs->style & WS_CHILD))
+ if (mAutoShow && !(cs->style & WS_CHILD))
ShowWindow(SW_SHOW);
return 0;
@@ -128,7 +164,7 @@ T2Dialog::T2DialogDef::T2DialogDef()
, modal(1)
, title(NULL)
, center(true)
- , flags(0x50000000) // is this a style?
+ , flags(WS_VISIBLE | WS_CHILD)
{
}
@@ -139,25 +175,25 @@ T2Dialog::T2DialogDef::T2DialogDef()
mModal = def.modal;
SetWindowText(def.title);
- CRect windowRect, clientRect, desktopRect;
+ CRect windowRect, clientRect, theDesktopRect;
GetWindowRect(windowRect);
GetClientRect(clientRect);
- GetDesktopWindow()->GetClientRect(desktopRect);
+ GetDesktopWindow()->GetClientRect(theDesktopRect);
def.width += (windowRect.Width() - clientRect.Width());
def.height += (windowRect.Height() - clientRect.Height());
int cx = def.center ? (mTemplate.pt.x - def.width / 2) : mTemplate.pt.x;
- if (cx < desktopRect.left)
- cx = desktopRect.left;
- if (cx + def.width >= desktopRect.right)
- cx = desktopRect.right - def.width;
+ if (cx < theDesktopRect.left)
+ cx = theDesktopRect.left;
+ if (cx + def.width >= theDesktopRect.right)
+ cx = theDesktopRect.right - def.width;
int cy = def.center ? (mTemplate.pt.y - def.height / 2) : mTemplate.pt.y;
- if (cy < desktopRect.top)
- cy = desktopRect.top;
- if (cy + def.height >= desktopRect.bottom)
- cy = desktopRect.bottom - def.height;
+ if (cy < theDesktopRect.top)
+ cy = theDesktopRect.top;
+ if (cy + def.height >= theDesktopRect.bottom)
+ cy = theDesktopRect.bottom - def.height;
SetWindowPos(NULL, cx, cy, def.width, def.height, SWP_NOZORDER);
}
@@ -179,8 +215,512 @@ void T2Dialog::CreateDlgItemLoop(T2DialogDef& def, char* data) {
}
}
-/*virtual*/ void T2Dialog::CreateDlgItem(CTokenizer& tokenizer, T2DialogDef& def) {
- // TODO: this requires like 500 other classes lmfao
+/*virtual*/ void T2Dialog::CreateDlgItem(CTokenizer& inTokenizer, T2DialogDef& inDef) {
+ const char *token = inTokenizer.Current();
+
+ if (!_stricmp(token, "WIDTH")) {
+ inDef.width = inTokenizer.NextInteger();
+ } else if (!_stricmp(token, "HEIGHT")) {
+ inDef.height = inTokenizer.NextInteger();
+ } else if (!_stricmp(token, "MODAL")) {
+ inDef.modal = 1;
+ } else if (!_stricmp(token, "MODALESS")) {
+ inDef.modal = 0;
+ } else if (!_stricmp(token, "TMODAL")) {
+ inDef.modal = 2;
+ } else if (!_stricmp(token, "TITLE")) {
+ inDef.title = inTokenizer.NextString();
+ } else if (!_stricmp(token, "FONTNAME")) {
+ mFontName = inTokenizer.NextString();
+ } else if (!_stricmp(token, "FONT")) {
+ int fontNum = inTokenizer.NextInteger();
+ int i;
+ for (i = 0; i < 10; i++) {
+ if (mFonts[i] && mFontNums[i] == fontNum)
+ break;
+ }
+
+ if (i == 10) {
+ mFontNums[mFontCount] = fontNum;
+#line 228
+ mFonts[mFontCount] = DEBUG_NEW CFont;
+
+ CString str;
+ if (mFontName[0] == '!') {
+ str = mFontName.Mid(1);
+ mFonts[mFontCount]->CreateFont(-abs(fontNum), 0, 0, 0, (fontNum > 0) ? FW_NORMAL : FW_BOLD, false, false, false, SHIFTJIS_CHARSET, OUT_TT_PRECIS, CLIP_TT_ALWAYS, DRAFT_QUALITY, DEFAULT_PITCH, str);
+ } else {
+ mFonts[mFontCount]->CreateFont(-abs(fontNum), 0, 0, 0, (fontNum > 0) ? FW_NORMAL : FW_BOLD, false, false, false, SHIFTJIS_CHARSET, OUT_TT_PRECIS, CLIP_TT_ALWAYS, PROOF_QUALITY, DEFAULT_PITCH, mFontName);
+ }
+
+ mCurrentFont = mFontCount;
+ mFontCount++;
+ } else {
+ mCurrentFont = i;
+ }
+ } else if (!_stricmp(token, "VISIBLE")) {
+ inDef.flags |= WS_VISIBLE;
+ } else if (!_stricmp(token, "INVISIBLE")) {
+ inDef.flags &= ~WS_VISIBLE;
+ } else if (!_stricmp(token, "CENTER")) {
+ inDef.center = true;
+ } else if (!_stricmp(token, "LEFTTOP")) {
+ inDef.center = false;
+ } else if (!_stricmp(token, "OK")) {
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+#line 263
+ T2DlgItemOK *item = DEBUG_NEW T2DlgItemOK(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, 1);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "CANCEL")) {
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+#line 274
+ T2DlgItemCANCEL *item = DEBUG_NEW T2DlgItemCANCEL(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, 2);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "BUTTON")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 289
+ T2DlgItemTButton *item = DEBUG_NEW T2DlgItemTButton(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "IBUTTON")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 304
+ T2DlgItemIButton *item = DEBUG_NEW T2DlgItemIButton(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "CHECK")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+#line 316
+ T2DlgItemCheck *item = DEBUG_NEW T2DlgItemCheck(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "IBUTTON")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+#line 329
+ T2DlgItemICheck *item = DEBUG_NEW T2DlgItemICheck(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "IREPEAT")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 344
+ T2DlgItemIRepeater *item = DEBUG_NEW T2DlgItemIRepeater(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "RADIO")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+#line 357
+ T2DlgItemRadioButton *item = DEBUG_NEW T2DlgItemRadioButton(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(inTokenizer.Current(), "TXRADIO")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 371
+ T2DlgItemRadioText *item = DEBUG_NEW T2DlgItemRadioText(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "EDIT")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+ int maxChars = inTokenizer.NextInteger();
+#line 386
+ T2DlgItemEdit *item = DEBUG_NEW T2DlgItemEdit(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags | WS_CLIPCHILDREN, rect, this, id);
+ item->CreateSubItem(&maxChars);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "HSCROLL")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 400
+ T2DlgItemHScr *item = DEBUG_NEW T2DlgItemHScr(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "VSCROLL")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 414
+ T2DlgItemVScr *item = DEBUG_NEW T2DlgItemVScr(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "BOX")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 428
+ T2DlgItemBox *item = DEBUG_NEW T2DlgItemBox(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "TEXT")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 443
+ T2DlgItemText *item = DEBUG_NEW T2DlgItemText(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "DIALOG")) {
+ UINT id = inTokenizer.NextInteger();
+ T2DLGTEMPLATE theTemplate;
+ theTemplate.resID = inTokenizer.NextInteger();
+ theTemplate.pt.x = inTokenizer.NextInteger();
+ theTemplate.pt.y = inTokenizer.NextInteger();
+ theTemplate.moduleHandle = mTemplate.moduleHandle;
+#line 457
+ T2Dialog *theDialog = DEBUG_NEW T2Dialog;
+ theDialog->Realize(this, &theTemplate, mTowerDoc, mImageObj, NULL, false, this, id, true);
+ } else if (!_stricmp(token, "PPVIEW")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 468
+ T2DlgItemPeopleView *item = DEBUG_NEW T2DlgItemPeopleView(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "PGAGE")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 482
+ T2DlgItemProfitsGage *item = DEBUG_NEW T2DlgItemProfitsGage(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "CGAGE")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 496
+ T2DlgItemCustomerGage *item = DEBUG_NEW T2DlgItemCustomerGage(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "SGAGE")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 510
+ T2DlgItemStressGage *item = DEBUG_NEW T2DlgItemStressGage(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "EGAGE")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 524
+ T2DlgItemPPLEvalGage *item = DEBUG_NEW T2DlgItemPPLEvalGage(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "BGAGE")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 538
+ T2DlgItemBelongGage *item = DEBUG_NEW T2DlgItemBelongGage(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "TABLE")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 552
+ T2DlgItemTable *item = DEBUG_NEW T2DlgItemTable(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "POPUP")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 566
+ T2DlgItemPopup *item = DEBUG_NEW T2DlgItemPopup(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "PINFTBL")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 580
+ T2PluginInfoTable *item = DEBUG_NEW T2PluginInfoTable(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "IMAGE")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 594
+ T2DlgItemImage *item = DEBUG_NEW T2DlgItemImage(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "MERF")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+ int maxChars = inTokenizer.NextInteger();
+#line 608
+ T2DlgItemMerchandiseField *item = DEBUG_NEW T2DlgItemMerchandiseField(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags | WS_CLIPCHILDREN, rect, this, id);
+ item->CreateSubItem(&maxChars);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "ARROWS")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+#line 619
+ T2DlgItemArrows *item = DEBUG_NEW T2DlgItemArrows(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags | WS_CLIPCHILDREN, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "LISTBOX")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 634
+ T2DlgItemListBox *item = DEBUG_NEW T2DlgItemListBox(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags | WS_CLIPCHILDREN, rect, this, id);
+ item->CreateSubItem();
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "TBDISABLED")) {
+ UINT id = inTokenizer.NextInteger();
+ CString text = inTokenizer.NextString();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 649
+ CToggleButtonDisabled *item = DEBUG_NEW CToggleButtonDisabled(mTowerDoc, mImageObj, mPalette);
+ item->Create(text, inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "STIMETBL")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 662
+ T2DlgItemSTimeTbl *item = DEBUG_NEW T2DlgItemSTimeTbl(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "MOVIE")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 676
+ T2DlgItemMovie *item = DEBUG_NEW T2DlgItemMovie(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags | WS_CLIPCHILDREN, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "MOVTBL")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 690
+ T2MovieTable *item = DEBUG_NEW T2MovieTable(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "ANIM")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 705
+ T2DlgItemAnimation *item = DEBUG_NEW T2DlgItemAnimation(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags | WS_CLIPCHILDREN, rect, this, id);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "PROG")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 719
+ T2DlgItemProgress *item = DEBUG_NEW T2DlgItemProgress(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags | WS_CLIPCHILDREN, rect, this, id);
+ item->CreateSubItem();
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else if (!_stricmp(token, "ATZTBL")) {
+ UINT id = inTokenizer.NextInteger();
+ RECT rect;
+ rect.left = inTokenizer.NextInteger();
+ rect.top = inTokenizer.NextInteger();
+ rect.right = inTokenizer.NextInteger();
+ rect.bottom = inTokenizer.NextInteger();
+#line 733
+ T2AdvertiseTable *item = DEBUG_NEW T2AdvertiseTable(mTowerDoc, mImageObj, mPalette);
+ item->Create("", inDef.flags, rect, this, id);
+ item->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ item->SetFont(*mFonts[mCurrentFont]);
+ } else {
+ // "ダイアログテキスト内に見知らぬトークンがあります:"
+ CString err = "\x83\x5F\x83\x43\x83\x41\x83\x8D\x83\x4F\x83\x65\x83\x4C\x83\x58\x83\x67\x93\xE0\x82\xC9\x8C\xA9\x92\x6D\x82\xE7\x82\xCA\x83\x67\x81\x5B\x83\x4E\x83\x93\x82\xAA\x82\xA0\x82\xE8\x82\xDC\x82\xB7\x81\x46";
+ err += token;
+ MessageBox(err, NULL, MB_ICONEXCLAMATION);
+ }
}
void T2Dialog::OnDestroy() {
@@ -195,25 +735,25 @@ void T2Dialog::OnDestroy() {
}
}
-int T2Dialog::OnQueryNewPalette() {
+BOOL T2Dialog::OnQueryNewPalette() {
return CWnd::OnQueryNewPalette();
}
-int T2Dialog::OnEraseBkgnd(CDC* dc) {
- int result = true;
+BOOL T2Dialog::OnEraseBkgnd(CDC* dc) {
+ BOOL result = true;
if (!OnT2PreEraseBkgnd(dc)) {
- int savedDC = dc->SaveDC();
+ int saved = dc->SaveDC();
dc->SelectPalette(mPalette, false);
dc->RealizePalette();
- CBrush brush;
- brush.CreateStockObject(LTGRAY_BRUSH);
+ CBrush theBrush;
+ theBrush.CreateStockObject(LTGRAY_BRUSH);
CRect rect1;
GetClientRect(rect1);
- dc->FillRect(rect1, &brush);
+ dc->FillRect(rect1, &theBrush);
CPen pen1;
pen1.CreatePen(PS_SOLID, 0, PALETTERGB(255, 255, 255));
@@ -234,7 +774,7 @@ int T2Dialog::OnEraseBkgnd(CDC* dc) {
dc->LineTo(rect2.right - 1, rect2.bottom - 1);
dc->LineTo(rect2.left, rect2.bottom - 1);
- dc->RestoreDC(savedDC);
+ dc->RestoreDC(saved);
result = OnT2EraseBkgnd(dc);
}
@@ -242,20 +782,20 @@ int T2Dialog::OnEraseBkgnd(CDC* dc) {
return result;
}
-/*virtual*/ int T2Dialog::OnCommand(UINT cmd, long data) {
- int result = true;
+/*virtual*/ BOOL T2Dialog::OnCommand(WPARAM wParam, LPARAM lParam) {
+ BOOL result = true;
- WORD hi = HIWORD(cmd);
- WORD lo = LOWORD(cmd);
+ WORD code = HIWORD(wParam);
+ WORD id = LOWORD(wParam);
- if ((lo == 1 || lo == 2) && (hi == 0)) {
- if (lo == 1)
+ if ((id == 1 || id == 2) && (code == 0)) {
+ if (id == 1)
OnT2OK();
else
OnT2Cancel();
- DoClose(lo);
+ DoClose(id);
} else {
- result = OnT2DialogCommand(cmd, data);
+ result = OnT2DialogCommand(wParam, lParam);
}
return result;
@@ -284,17 +824,20 @@ void T2Dialog::DoClose(int nResult) {
return 1;
}
-void T2Dialog::MakeRadioGroup(int, int, int) {
- // TODO - depends on vfCC of something
+void T2Dialog::MakeRadioGroup(int inBaseID, int inCount, int inSelected) {
+ for (unsigned short i = 1; i <= inCount; i++) {
+ unsigned short id = inBaseID + i;
+ ((T2DlgItem *) GetDlgItem(id))->SetValue(i == inSelected);
+ }
}
-void T2Dialog::MakeTabPanel(int baseID1, int baseID2, int count, int currentIndex) {
- for (unsigned short i = 1; i <= count; i++) {
- unsigned short id2 = baseID2 + i;
- unsigned short id1 = baseID1 + i;
- GetDlgItem(id2)->EnableWindow(i != currentIndex);
- if (baseID1 != 0)
- GetDlgItem(id1)->ShowWindow((i != currentIndex) ? SW_HIDE : SW_SHOW);
+void T2Dialog::MakeTabPanel(int inBaseID1, int inBaseID2, int inCount, int inSelected) {
+ for (unsigned short i = 1; i <= inCount; i++) {
+ unsigned short id2 = inBaseID2 + i;
+ unsigned short id1 = inBaseID1 + i;
+ GetDlgItem(id2)->EnableWindow(i != inSelected);
+ if (inBaseID1 != 0)
+ GetDlgItem(id1)->ShowWindow((i != inSelected) ? SW_HIDE : SW_SHOW);
}
}