I needed access to some BWCC type controls within Delphi, to pretend that a
Delphi 1.0 project I was developing looked like C++.  This was because the
project was to be an extension of an existing C++ project.  I elected to use
Delphi to make my life (and anyone else's maintaining it) easier.  I found the
original BWCCDEL unit on the Delphi SuperPage, but found it had various
problems.  These I have fixed.

The BorBtn Kind property now correctly reflects the type of button it is
during design time and run time immediately the Kind is changed.  I also
added proper shortcuts to the Borland picture buttons, and sorted out a
large resource problem, where the bitmaps for the BorBtns were not being
deleted.  For this I had to do rather a major re-write in the BMP handling area.  

Also included is a method of loading a DLL library dynamically, and definitions
of function pointers loaded directly from the DLL.

I added the bwCustom type, which can be setup at design time, by loading the
three required bitmaps into the properties at design time, and specifying that
the button kind is bwCustom.  These custom buttons, can also have accelerator
key shortcuts, by setting the Caption property (these captions will never be
displayed) to '&U' in the demo example.  This private internal variable has
been made persistent - an interesting trick.

Another interesting trick, is the ability to find out which PAS unit a
Class is defined in - See GETUNITNAME function.

In addition I've included a demo application.

NOTE: Whilst testing the loading/unloading of BWCC.DLL from memory, I noticed
      that a call to WinProcs.LoadLibrary('BWCC.DLL') was loading the DLL
      into memory with a usage count of 2.  My UnloadLibrary was only decrementing
      the count by 1, leaving the DLL in memory after my project and Delphi
      shutdown.  This did not occur on a colleagues system.
      I finally tracked this down to a line in my WIN.INI:

      [BWCC]
      BitmapLibrary=BWCC.DLL

      Removing this allowed BWCC.DLL to load and unload correctly.  If anyone
      can tell me what put this in my WIN.INI, and what its for I would be
      interested to know.

My thanks to Xiao Lui to creating the initial wrapper and getting so nearly
there - it saved me a lot of initial work.

Andy Strong  30 June 1997


============================> ORIGINAL NOTES <=================================
Developer's Notes of Using BWCC Components in Delphi

Author: Xiao Luo

BWCCDel unit included 4 components--TBorBtn, TBorRadio, TBorCheck, TBorShade
and load them from the BWCC.DLL run time library.  The program need BWCC.DLL
at run time within the Windows system directory or current directory.

Note: For non DLL required BWCC Components, check out another "BWCC Radio and
Check Button Unit." also at Delphi Super Page.

You can use BWCC Components by install the unit to the Delphi Component Speed
Bar.



TBorBtn

  Same as TButton Control

  Property Kind:
      --The kind of button you want to use at design time.  Warning:
  BWCC will not repaint the control when you set the kind at design time. And 
  there is no build in shortcut key for BWCC Buttons.  You can put the 
  modification of Kind Property at Form's OnActive EVENT(Even OnCreate won't
  work).  You can either set the shortcut key by modify the "Caption" Property 
  and Font Property or you can set it in the Form's "OnKeyDown" EVENT.

  Procedure SetBits(Bit1,Bit2,Bit3:HBitmap);
      --This Procedure will set the user defined bitmap for the button.  The
  package also attached three bitmap file, which would be the default bitmap 
  style for BWCC. You just put whatever you want on the bitmap's face, and
  put'em into a RES file and Bit1,Bit2,Bit3 is three bitmap's handle.
      Bit1  The bitmap is displayed when the button is normal.
      Bit2  The bitmap is displayed when the button is pressed(Highlighted).
      Bit3  The bitmap is displayed when the button is receiving a keyboard 
            focus.


TBorRadio, TBorCheck
  The have the exact same property and function set of standard windows 
  controls, except BWCC library overrided the WM_PAINT message.

  Note:You can't change the bacground color of these controls directly through 
  the color property, but you can change the background color by retriving the 
  WS_COLORCTL and SetBKColor API function.


TBorShade
  Borland Style Shade.  Currently not used in most applications.  
  

Functions and Procedures

  Function BWCCVersion:Single; {Return the current BWCC Version}
  Function BWCCMessageBox(Parent:Word;Text,Caption:PChar;TextStyle:Word):integer;
       {BWCC dialog box procedure, use same as MessageBox API function} 

  Procedure BWCCregister(Hinst:Word);{Register to BWCC}
       You should always call this function to BWCC, and register your
       application instance with BWCC library at the beginning of your
       application.


Varibles
 
  Loaderror:word;
    this Varible saved the instance of BWCC at the loading time.

    Note:Always close the BWCC library at the end of your application.


It's freeware, enjoy it. (or you can send me thanking E-mail :-) )

If you have the newer version of BWCC, please note me.
This version is designed for both Delphi 1.0 and 2.0 (Although, the code is
written by 1.0), BWCC.DLL is a 16-bit Verison.  If you want get 32-bit 
version, you can contact Borland Int'l.

If you have any question, please contact: 
sluox@callisto.wl.k12.in.us
or 
Http://www.geocities.com/wallstreet/3160/ 
for my latest E-mail address.
