Files
TeslaRel410/BORLAND/BC45/INCLUDE/OWL/BUTTONGA.H
T
CydandClaude Fable 5 63312e07f9 source410: literal 4.10 source reconstruction + BC++ 4.52 fleet toolchain archived
- 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>
2026-07-19 07:33:26 -05:00

136 lines
4.4 KiB
C++

//----------------------------------------------------------------------------
// ObjectWindows
// (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
//
// Definition of class TButtonGadget.
//----------------------------------------------------------------------------
#if !defined(OWL_BUTTONGA_H)
#define OWL_BUTTONGA_H
#if !defined(OWL_GADGET_H)
# include <owl/gadget.h>
#endif
class _OWLCLASS TCelArray;
//
// class TButtonGadget
// ----- -------------
//
// buttons begin highlighting and do a capture when pressed (the mouse down
// occurs). they cancel highlighting when the mouse exits, but begin
// highlighting again when the mouse re-enters. when the mouse goes up the
// capture is released
//
// there are two basic type of buttons: commands and settings (attribute
// buttons). Settings can be exclusive (like a radio button) or non-exclusive
// (like a check box)
//
// there are three normal button states: up, down, and indeterminate. in
// addition the button can be highlighting (pressed) in all three states
//
// commands can only be in the "up" state. settings can be in all three states
//
class _OWLCLASS TButtonGadget : public TGadget {
public:
enum TState {Up, Down, Indeterminate};
enum TType {Command, Exclusive, NonExclusive};
enum TShadowStyle {SingleShadow = 1, DoubleShadow = 2};
TButtonGadget(TResId bmpResId,
int id,
TType type = Command,
bool enabled = false, // initial state before cmd enabling
TState state = Up,
bool repeat = false);
~TButtonGadget();
void SetButtonState(TState);
TState GetButtonState() {return State;}
TType GetButtonType() {return Type;}
void GetDesiredSize(TSize& size);
void SetBounds(TRect& r);
// A couple of button style options
//
void SetNotchCorners(bool notchCorners=true)
{NotchCorners = notchCorners;}
void SetShadowStyle(TShadowStyle style=DoubleShadow);
void SetAntialiasEdges(bool anti=true) {AntialiasEdges=anti;}
// Override and initiate a WM_COMMAND_ENABLE message
//
void CommandEnable();
void SysColorChange();
protected:
TResId ResId;
TCelArray* CelArray;
TPoint BitmapOrigin;
TState State : 4;
TType Type : 4;
TShadowStyle ShadowStyle : 4;
bool Repeat : 1;
bool NotchCorners : 1;
bool Pressed : 1;
bool AntialiasEdges : 1;
// Override basic TGadget member functions
//
void Paint(TDC& dc);
void Invalidate();
// Override TGadget member functions and respond to user fiddling with the
// button by self-sending button protocol messages
//
void LButtonDown(uint modKeys, TPoint& p);
void MouseMove(uint modKeys, TPoint& p);
void MouseEnter(uint modKeys, TPoint& p);
void MouseLeave(uint modKeys, TPoint& p);
void LButtonUp(uint modKeys, TPoint& p);
enum {
//CelMask,
CelNormal, // Normal state
CelDisabled, // Disabled (grayed)
CelIndeterm, // Indeterminate-neither normal nor down
CelDown, // Down or checked
CelsTotal
};
virtual TDib* GetGlyphDib();
virtual void ReleaseGlyphDib(TDib* glyph);
virtual void BuildCelArray();
//
// button protocol
// ------ --------
//
//
// invoked by mouse-down & mouse enter events. sets member data "Pressed"
// to true and highlights the button
//
virtual void BeginPressed(TPoint& p);
//
// invoked by mouse exit events. sets member data "Pressed" to false and
// paints the button in its current state
//
virtual void CancelPressed(TPoint& p);
//
// invoked by mouse-up event inside the Gadget. sets member data "Pressed"
// to false, changes state for attribute buttons, and paints the button
// in its current state
//
// generates WM_COMMAND
//
virtual void Activate(TPoint& p);
private:
void CheckExclusively();
};
#endif // OWL_BUTTONGA_H