- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
148 lines
3.8 KiB
C++
148 lines
3.8 KiB
C++
//----------------------------------------------------------------------------
|
|
// ObjectWindows - (C) Copyright 1993 by Borland International
|
|
//----------------------------------------------------------------------------
|
|
#include <owl\owlpch.h>
|
|
#include <owl\applicat.h>
|
|
#include <owl\dialog.h>
|
|
#include <owl\framewin.h>
|
|
#include <owl\vbxctl.h>
|
|
#include "vbxctlx.h"
|
|
|
|
//#define USE_RESOURCE_DLL
|
|
|
|
class TTestDialog : public TDialog, public TVbxEventHandler {
|
|
public:
|
|
TTestDialog(TWindow* parent, const char* name, TModule* module=0);
|
|
|
|
protected:
|
|
void SetupWindow();
|
|
|
|
// OWL Aliases for VBX controls in dialog
|
|
//
|
|
TVbxControl* Switch1;
|
|
TVbxControl* Switch2;
|
|
TVbxControl* Switch3;
|
|
TVbxControl* Switch4;
|
|
TVbxControl* Gauge1;
|
|
TVbxControl* Gauge2;
|
|
TVbxControl* Gauge3;
|
|
TVbxControl* Gauge4;
|
|
|
|
void EvTimer(UINT timerId);
|
|
void EvDropSrc(VBXEVENT far* event);
|
|
void EvDropDest(VBXEVENT far* event);
|
|
void UpdateGauge(TVbxControl* sw, TVbxControl* ga);
|
|
|
|
DECLARE_RESPONSE_TABLE(TTestDialog);
|
|
};
|
|
|
|
DEFINE_RESPONSE_TABLE2(TTestDialog, TDialog, TVbxEventHandler)
|
|
EV_WM_TIMER,
|
|
EV_VBXEVENTNAME(IDC_BIPICT1,"DragDrop",EvDropSrc),
|
|
EV_VBXEVENTNAME(IDC_BIPICT2,"DragDrop",EvDropSrc),
|
|
EV_VBXEVENTNAME(IDC_BIPICT3,"DragDrop",EvDropDest),
|
|
END_RESPONSE_TABLE;
|
|
|
|
TTestDialog::TTestDialog(TWindow* parent, const char* name, TModule* module)
|
|
: TDialog(parent, name, module)
|
|
{
|
|
Switch1 = new TVbxControl(this, IDC_BISWITCH1);
|
|
Switch2 = new TVbxControl(this, IDC_BISWITCH2);
|
|
Switch3 = new TVbxControl(this, IDC_BISWITCH3);
|
|
Switch4 = new TVbxControl(this, IDC_BISWITCH4);
|
|
Gauge1 = new TVbxControl(this, IDC_BIGAUGE1);
|
|
Gauge2 = new TVbxControl(this, IDC_BIGAUGE2);
|
|
Gauge3 = new TVbxControl(this, IDC_BIGAUGE3);
|
|
Gauge4 = new TVbxControl(this, IDC_BIGAUGE4);
|
|
}
|
|
|
|
void
|
|
TTestDialog::SetupWindow()
|
|
{
|
|
TDialog::SetupWindow();
|
|
SetTimer(1, 1); // As fast as possible
|
|
}
|
|
|
|
void
|
|
TTestDialog::EvTimer(UINT /*timerId*/)
|
|
{
|
|
UpdateGauge(Switch1, Gauge1);
|
|
UpdateGauge(Switch2, Gauge2);
|
|
UpdateGauge(Switch3, Gauge3);
|
|
UpdateGauge(Switch4, Gauge4);
|
|
}
|
|
|
|
void
|
|
TTestDialog::UpdateGauge(TVbxControl *sw, TVbxControl* ga)
|
|
{
|
|
BOOL on=FALSE;
|
|
int val=0;
|
|
if( sw->GetProp("On", on) && on )
|
|
if( ga->GetProp("Value", val) )
|
|
ga->SetProp("Value", (val + 5) % 100);
|
|
}
|
|
|
|
void
|
|
TTestDialog::EvDropSrc(VBXEVENT far * /*event*/)
|
|
{
|
|
MessageBeep(0);
|
|
}
|
|
|
|
void
|
|
TTestDialog::EvDropDest(VBXEVENT far * event)
|
|
{
|
|
long pic;
|
|
if (VBXGetPropByName(VBX_EVENTARGNUM(event,HCTL,0), "Picture", &pic))
|
|
VBXSetPropByName(event->Control, "Picture", pic);
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
class TTestApp : public TApplication {
|
|
public:
|
|
TTestApp() : TApplication() {}
|
|
~TTestApp() {delete ResModule;}
|
|
|
|
protected:
|
|
void InitMainWindow() {
|
|
MainWindow = new TFrameWindow(0, "Dialog Tester", 0);
|
|
MainWindow->AssignMenu("COMMANDS");
|
|
#if defined(USE_RESOURCE_DLL)
|
|
ResModule = new TModule("resource.dll");
|
|
# if 1
|
|
VBXEnableDLL(*this, *ResModule);
|
|
# else
|
|
WNDCLASS wc;
|
|
GetClassInfo("VBCONTROL", &wc);
|
|
wc.hInstance = *ResModule;
|
|
RegisterClass(&wc);
|
|
# endif
|
|
#else
|
|
ResModule = 0;
|
|
#endif
|
|
}
|
|
void CmTest() {TTestDialog(MainWindow, "SAMPLES", ResModule).Execute();}
|
|
|
|
private:
|
|
TModule* ResModule;
|
|
|
|
DECLARE_RESPONSE_TABLE(TTestApp);
|
|
};
|
|
|
|
DEFINE_RESPONSE_TABLE(TTestApp)
|
|
EV_COMMAND(CM_TEST, CmTest),
|
|
END_RESPONSE_TABLE;
|
|
|
|
int
|
|
OwlMain(int, char**)
|
|
{
|
|
try {
|
|
TBIVbxLibrary vbxLib; // constructing this loads & inits the library
|
|
return TTestApp().Run();
|
|
}
|
|
catch (xmsg& x) {
|
|
::MessageBox(0, x.why().c_str(), "OWL Examples", MB_OK);
|
|
return -1;
|
|
}
|
|
}
|