Unit Bwccdel

***************************************************************************** ** ** BWCCDEL - Delphi encapsulation of BWCC controls. Shows how to encapsulate ** subclassing of controls from other DLLs. ** Also supplies a Borland style dialogue (BWCCMessageBox) box which ** expects the same parameters as the WinAPI MessageBox call. ** I have added some interesting approaches here: ** for Custom buttons, the three bitmaps are stored internally as a ** three element array of bitmaps, but displayed in the object ** inspector as three separate properties; ** For the Custom buttons, I have allowed the caption to be set for ** the purpose of accelerator key access, but the caption is never ** displayed on the button. The caption is NOT saved, but rather ** an internal private variable is made to be persistent; ** A neat trick for finding out what PAS unit a class is defined in, ** see GETUNITNAME function. ** ** History ** ======= ** ** Version Date Description ** 2.10 05/07/97 Adding the new BorSign Type Into this BWCC Control Set. ** Renewed by Xiao Luo sluox@wl.k12.in.us ** ** 1.10 30/06/97 Modified and sections rewritten by Andy Strong. ** e-mail: andy@nbaqsl.co.uk ** Added bwCustom BorBtn bitmap type. ** Fixed bug where pictures on BorBtns didn't always display. ** Fixed way BWCC version is generated. ** Fixed resource leak in BorBtn. ** Fixed button focus rectangle around BorBtn not clearing. ** Added Accelerator Key handling for all BorButton types. ** Fixed bug where focus rect did not show correctly around ** the Radio Buttons and CheckBoxes. ** Modified Caption handling for non bwWordOnly btns. ** Ensured BWCC load count only gets incremented by 1 not 2. ** Added dynamic load of library and functions. ** Downloaded from Delphi Super Page. ** 1.00 ??/??/?? Original by Xiao Luo ** ** Original Message ** ======== ======= ** You can use this program in any application you want without ** notice the author of this program. You may freely distrubute ** this program as long as it's author is presented clearly as ** the original author. You may also change this program and reproduce ** newer verison for this program as long as it's free. ** ** Supported by DragonsoftMedia Inc. Xiao Luo (C) 1996,1997 **

Classes

TBorBtn -
TBorCheck -
TBorRadio -
TBorShade -
TBorSign -

Functions

BWCCVersion - ** Sanitised version of BWCC version number.
Register -

Types

TAccelString
TBWCCButtonKind
TDefStyle
TShadeStyle
TSignStyle
TSTATE

Constants

BBM_SETBITS
BBN_GOTABTAB
BBN_GOTATAB
BBN_MOUSEENTER
BBN_MOUSELEAVE
BBN_SETFOCUS
BBN_SETFOCUSMOUSE
BBS_BITMAP
BBS_OWNERDRAW
BBS_PARENTNOTIFY
BORBTNTEXTS
BSS_ALIGNMASK
BSS_CAPTION
BSS_CENTER
BSS_CTLCOLOR
BSS_GROUP
BSS_HBUMP
BSS_HDIP
BSS_LEFT
BSS_NOPREFIX
BSS_RGROUP
BSS_RIGHT
BSS_VBUMP
BSS_VDIP
BTNBMPBASES
BWCCLIBRARYNAME
idhelp

Variables

BWCCGetPattern
BWCCGetVersion
BWCCIntlInit
BWCCIntlTerm
BWCCmessagebox
BWCCRegister
LibHandle


Functions


function BWCCVersion: single;

** Sanitised version of BWCC version number. ** BWCCGetVersion Function returns a Longint. ** The High Word returns locale, the low word returns the version number. ** Locale 1 = US ** 2 = Japan. ** This version function calculation gives: ** LoWord(BWCCGetVersion) = 512; Result := 2.00 ** LoWord(BWCCGetVersion) = 515; Result := 2.03

procedure Register;


Types


TAccelString = string[2]

TBWCCButtonKind = (bwWordOnly, bwOK, bwCancel, bwAbort, bwRetry, bwIgnore, bwYes, bwNo, bwHelp, bwCustom);

TDefStyle = (dsDefaultButton, dsPushButton);

TShadeStyle = (ssGroup,ssRaisedgroup,ssHdip,ssVdip,ssHBump,ssVBump);

TSignStyle=(Stop,Question,Exclamation,Information);

TSTATE = (tsHighlighted, tsNormal);

Constants

BBM_SETBITS = BM_SETSTYLE + 10

BBN_GOTABTAB = BN_DOUBLECLICKED + 13

BBN_GOTATAB = BN_DOUBLECLICKED + 12

BBN_MOUSEENTER = BN_DOUBLECLICKED + 14

BBN_MOUSELEAVE = BN_DOUBLECLICKED + 14

BBN_SETFOCUS = BN_DOUBLECLICKED + 10

BBN_SETFOCUSMOUSE = BN_DOUBLECLICKED + 11

BBS_BITMAP = $8000

BBS_OWNERDRAW = $1000

BBS_PARENTNOTIFY = $2000

BORBTNTEXTS = ('', '', '', '&A', '&R', '&I', '&Y', '&N', '', '')

Accelerator Captions for standard BorBtn buttons (same order as TBWCCBUTTONKIND)

BSS_ALIGNMASK = $030

BSS_CAPTION = $8000

BSS_CENTER = $0100

BSS_CTLCOLOR = $4000

BSS_GROUP = 1

BSS_HBUMP = 4

BSS_HDIP = 2

BSS_LEFT = 0

BSS_NOPREFIX = $2000

BSS_RGROUP = 6

BSS_RIGHT = $0200

BSS_VBUMP = 5

BSS_VDIP = 3

BTNBMPBASES = (1000, 3000, 5000)

Base IDs in BWCC for standard buttons

BWCCLIBRARYNAME = 'BWCC.DLL'

idhelp = 998


Variables

BWCCGetPattern : function : word

BWCCGetVersion : function : Longint

BWCCIntlInit : function (language: word): boolean

BWCCIntlTerm : function : boolean

BWCCmessagebox : function (WndParent: HWND; Txt,Caption: PChar; TextType: Word): Integer

BWCCRegister : procedure (hInst: word)

** Declare the function pointers for the calls into the BWCC DLL

LibHandle : THandle