From c920fe38a19013b99f3f74e48da9724fb053c212 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Sun, 9 Jul 2023 20:59:16 +0100 Subject: support building from VC++ IDE, add resources --- src/T2OpenSelectDlg.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/T2OpenSelectDlg.cpp') diff --git a/src/T2OpenSelectDlg.cpp b/src/T2OpenSelectDlg.cpp index e0e2d99..00e6162 100644 --- a/src/T2OpenSelectDlg.cpp +++ b/src/T2OpenSelectDlg.cpp @@ -1,9 +1,10 @@ +#include "StdAfx.h" #include "Bitmap.h" -#include "GlobalFunc.h" +#include "T2DLL/GlobalFunc.h" #include "T2.h" -#include "T2BitImage.h" -#include "T2DLL.h" -#include "T2ImageObj.h" +#include "T2DLL/T2BitImage.h" +#include "T2DLL/T2DLL.h" +#include "T2DLL/T2ImageObj.h" #include "T2OpenSelectDlg.h" #include "T2TowerDoc.h" @@ -41,7 +42,7 @@ void T2OpenSelectDlg::Setup() { CBitmap theBitmap; CBrush theBrush; - HRSRC resource = FindResource(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(174), "PALETTE"); + HRSRC resource = FindResource(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(ID_OPEN_SELECT_PALETTE), "PALETTE"); HGLOBAL theHandle = LoadResource(AfxGetApp()->m_hInstance, resource); void *resData = LockResource(theHandle); @@ -69,7 +70,7 @@ void T2OpenSelectDlg::Setup() { free(theLogPalette); - theBitmap.LoadBitmap(170); + theBitmap.LoadBitmap(IDB_PATTERN_BRUSH); theBrush.CreatePatternBrush(&theBitmap); } @@ -84,19 +85,19 @@ int T2OpenSelectDlg::ShowOpenSelectDialog() { T2DLGTEMPLATE tmpl; tmpl.pt = rect.CenterPoint(); tmpl.moduleHandle = instance; - tmpl.resID = 1000; + tmpl.resID = kDlgResID; T2TowerDoc *theDoc = NULL; #line 137 mImageObj = new T2ImageObj; - mImage = new T2BitImage(instance, 172, true); - mImageObj->AddObject(instance, 172, mImage); + mImage = new T2BitImage(instance, IDB_OPEN_SELECT, true); + mImageObj->AddObject(instance, IDB_OPEN_SELECT, mImage); Realize(this, &tmpl, theDoc, mImageObj, &mPalette2, true, NULL, 0, false); if (gT2App->mStrE0 != "") { - PostMessage(WM_COMMAND, 103); + PostMessage(WM_COMMAND, kCmdLoadFromPath); } else { ShowWindow(SW_SHOW); SetActiveWindow(); @@ -113,18 +114,18 @@ int T2OpenSelectDlg::ShowOpenSelectDialog() { WORD code = HIWORD(inWParam); WORD id = LOWORD(inWParam); - if (id == 101 && code == 0) { + if (id == kCmdNew && code == 0) { ShowWindow(SW_HIDE); mTowerDoc->LoadsWorldPlugin(); DoClose(id); - } else if (id == 102 && code == 0) { + } else if (id == kCmdOpen && code == 0) { ShowWindow(SW_HIDE); T2_APP->OnCmdOpen(); DoClose(id); - } else if (id == 100 && code == 0) { + } else if (id == kCmdExit && code == 0) { PostQuitMessage(0); DoClose(id); - } else if (id == 103 && code == 0) { + } else if (id == kCmdLoadFromPath && code == 0) { GetCurrentT2TowerDoc()->SetPathName(gT2App->mStrE0); GetCurrentT2TowerDoc()->OnOpenDocument(gT2App->mStrE0); gT2App->mStrE0 = ""; -- cgit v1.2.3