!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
If you have used versions of this component prior to v2.00 and have existing
forms with the TdfsColorButton component on them, please read the README.NOW
file included with this archive before doing anything else.
-------------------------------------------------------------------------------
TdfsColorButton v2.62
Description:
A Windows 95 and NT 4 style color selection button. It displays a palette
of 20 color for fast selction and a button to bring up the color dialog.
Copyright 1996, Brad Stowers. All Rights Reserved.
This component can be freely used and distributed in commercial and private
environments, provied this notice is not modified in any way and there is
no charge for it other than nomial handling fees. Contact me directly for
modifications to this agreement.
Contact Information:
The lateset version will always be available on the web at:
http://www.delphifreestuff.com
If you have any questions, comments or suggestions, please use the Delphi
Free Stuff Support Forum at:
http://www.delphifreestuff.com/discus/
If, for some reason, you can not use the web-based support forum, you can
email me at bstowers@delphifreestuff.com. However, the support forum will
always take precedence over direct email since it provides a resource that
others can use when they have a problem. Every message posted to the forum
is emailed directly to this account, so emailing me directly will not get
your message to me any faster. It will only make the message less important
for me to respond to since only one person (you) is benefiting from it
instead of everyone interested. Having said all that, please do email me
directly if it is regarding something that isn't really support related,
i.e. just to say thanks (as novel as that idea is).
Installation:
Delphi 1:
* Select the 'Options | Install Components' menu item.
* In the Install Components dialog, click the Add button.
* In the Add Module dialog, enter the full path name of the component's
registration unit (the unit that ends with 'Reg.pas', i.e.
'BrowseDrReg.pas') and click OK.
* In the Add Module dialog, click OK.
* The component library will be rebuilt and a new tab named 'DFS' will
be available on the Component Palette.
Delphi 2, C++Builder 1:
* Select the 'Component | Install' menu item.
* In the Install Components dialog, click the Add button.
* In the Add Module dialog, enter the full path name of the component's
registration unit (the unit that ends with 'Reg.pas', i.e.
'BrowseDrReg.pas') and click OK.
* In the Add Module dialog, click OK.
* The component library will be rebuilt and a new tab named 'DFS' will be
available on the Component Palette.
Delphi 3, 4, 5, C++Builder 3 & 4:
* Do one of the following:
+ Create a new package by selecting File | New and choosing Package from
the New tab in the dialog.
+ Open an existing package file. I suggest you do this if you already
have a package that you like to use for small, third party components.
I specifically have a package named "3rdParty.dpk" that I use for
small components that come from other people. Or, if you are using
several of my components, you might create a "DFS.dpk" package and
use it for all of my DFS components.
* In the resulting package window, click the Add button.
* In the Add dialog, on the Add Unit tab, enter the full path name of the
component's registration unit (the unit that ends with 'Reg.pas', i.e.
'BrowseDrReg.pas') and click OK.
* You may want to add the other source files (*.pas) to the package as
well in the same manner as you did the registration unit. While this is
not required, not doing it will cause compiler warnings when the package
is compiled. The component will function fine either way, but I
personally find the warnings very irritating and am not happy until
every compiler warning and hint is gone.
* If this package is new, or it has never been installed, click the
Install button in the package window. If this package is already
installed in Delphi, click the Compile button.
C++Builder 5 and up:
* Perform the "Delphi 3 and up, C++Builder 3 and up" steps above, except
for the last step (Compile or Install).
* Select the package the component has been added to, and choose
Project | Edit Option Source to open the package options in the editor.
* In the entry for PFLAGS, add the "-LUvcl50" option. For example:
* Perform the final step from above, Compile or Install.
* For Borland's official word on this situation, open the C++Builder help
file and search the index for "dsgnintf.dcu" and see the "Compiling
packages with DsgnIntf" section.
Delphi 6 and up:
* Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
for the last step (Compile or Install).
* Add the DesignIDE package to the Requires list of the package into which
the component is being installed.
* Perform the final step from above, Compile or Install.
* This is necessary because of changes to the design-time support units
introduced in Delphi 6. For complete information, see the Del6New.hlp
file in your Delphi 6 Help directory. In the index, search for
"upgrade issues" and in the resulting list of topics, select the
"DsgnIntf renamed and related changes" topic.
Known Issues:
* There are no known issues at this time.
Revision History:
2.61: + Updated for Delphi 6 compatibility. See updated install directions
above.
2.60: + Updated for C++Builder 5 compatibility.
2.59: + It's *really* D5 compatible now. Small change between the D5 eval
version and the real, shipping D5 version broke it.
2.58 + Wouldn't compile under Delphi 2. Don't know how long it's been that
way. Does that mean Delphi 2 has finally died and I can stop
supporting it?
2.57 + D5 compatibility.
2.56 + If the button was on something other than a form, say a tab page,
the form's caption did not get fixed up when the palette was
displayed.
2.55 + I had a report that the bitmap handle assignments with LoadResource
were failing for Eduardo Martins who had a large project, but that
changing to LoadFromResource fixed it. I've updated to use this fix
for all but Delphi 1, which doesn't have that method in TBitmap.
2.54 + Added CBtnReg unit. All IDE specific code (i.e. registering the
component, property editors, etc.) are contained in this unit. This
was done for two primary reasons: 1) Using the component in a Delphi
or C++Builder expert would register the component as well. 2) Reduce
code size in some cases -- usually the smart linker removes this sort
of stuff since the app never references it, but now it's for certain
since it isn't even in the unit. This change means that you need to
install the component using the new "registration" unit instead of
the unit containing the component.
2.53 + Moved hard-coded strings to resourcestrings for Delphi/Builder 3 and
higher. They are normal consts for older compilers. This aids in
internationalizing an app.
2.52 + The form that owns the button no longer appears to be inactive when
the color palette is displayed. I'm using FlashWindow to fool
Windows into showing the form's caption bar in the active state.
Many thanks to AISSSoft@aol.com for this idea.
2.51 + Minor update for Delphi 4 compatibility.
2.50 + Added CycleColors property. If set, clicking on the color portion of
the button will cycle to the next palette color, and clicking on the
arrow portion will drop down the palette. If not set, it functions
as before, dropping the palette no matter where it was clicked.
+ Flat buttons (Win32 only) look more like they do in IE4. Doesn't have
as hard of an edge on it now.
+ Clicking the button while the color palette is displayed will now hide
the color palette instead of redisplaying it.
+ Flat buttons (Win32 only) now draw as if they were selected at
design-time. Behaves more like standard flat speed/toolbar buttons.
+ OtherColor property value could get reset during execution.
+ Added public property IgnoreTopmosts. If you set this to TRUE, the
calls to NormalizeTopMosts and RestoreTopmosts will NOT be made.
Normally, these calls should be fine, but I have had some reports of
strange things going on with window z-orders being changed around and
I suspect these calls might be doing it. If you aren't experiencing
anything like this, you can safely ignore this property.
+ Added ShowColorHints property and related OnGetColorHintText event.
Setting this property causes the color palette to show a hint for
each color square that displays the RGB value of the color. For
example, then hint for a white square would be 'RGB = 255 255 255'.
This hint string can be modified via the OnGetColorHintText event.
This event is passed the TColor that needs a hint, the X, Y index into
the palette color array (not the X,Y cursor position) where 0,0 is the
"other" color, and a var string parameter to put the hint text in.
This string initially will contain the default hint text, and setting
it to an empty string ('') will prevent the hint from showing at all.
2.11 + Added Version property.
2.10 + 32-bit version now has a keyboard interface. Works as you would
expect: left, right, up and down keys move around. Won't work in
Delphi 1 because of a VCL bug that insists on focusing the "Other"
button. D2, D3, C1 and C3 do not have this problem.
2.01 + Fixed CustomColors property editor. It was not wide enough for all
of the color boxes.
+ Fixed internal compiler error when compiled under C++Builder 1 with
Pascal compiler options enabled.
+ Fixed problem with C++Builder 3 run-time packages.
2.00 + The "stream read error" fix broke something else; PaletteColors and
CustomColors properties would never write updated data, so any changes
you made to them at design-time would be lost if you viewed them as
text or closed the form. I've REALLY fixed it this time, but I've
broken previous versions because the streaming mechanism changed
again (for the LAST time, NEVER AGAIN, I promise). Make sure you
read the README.NOW file if you are upgrading from a previous version.
+ There was no visual indication if the button was disabled (Enabled
property set to false). The color box is now "shaded" out and the
drop down arrow is gray.
+ Added work-around for a bug in the Delphi 2 compiler. With
optimizations enabled, the DrawItem method would not compile. I've
selectively turned off compiler optimization for that routine if you
are compiling under Delphi 2.
+ Framing rectangles in the color palette were not using system defined
3D colors. The also suffered from the LineTo problem that the drop
down arrow used to. Thanks to J. C. Kiran for
this one.
+ Fixed problem with EnumObjects call causing GPFs under Delphi 1.
Thanks go to Bruno Sonnino for this one.
1.80 + Fixed the "stream read error" when trying to copy the component or
edit a form containing it as text. Unfortunately, this makes it
incompatible with previous versions of the component. You will have
to manually remove any TdfsColorButton components you have on your
forms. Next, open the CBtnForm.pas file and remove the period from
the first line so that it reads:
{$DEFINE FIX_STREAM_ERROR}
Now recompile the component into Delphi and re-add the component to
your form(s). You can now cut/paste and edit the form as text.
In case you are wondering, the fix is not enabled by default because
I know MANY of you don't read this information until after you've
tried playing around with it in the IDE. I didn't want to break
everyone's code: form's won't even load at all if they have an old
version of the component on them. :(
Many appologies for letting this one slip past me.
I will phase out the $DEFINE in the next version, so please don't
put off making this change any longer than you have to.
+ Selection palette is now taskbar aware. That is, if the palette would
be partially covered by a non-autohide task bar, it now repositions
itself to avoid this. It also does the same if would be partially
obscured because it is to close to the left or right edge of the
screen.
+ Delphi 2, 3 and C++B version has a new property: Flat. Works like
the toolbar button's Flat property. If someone REALLY needs this
property for Delphi 1, I'll look into adding it.
+ Fixed problem where palette wasn't visible if the button was on a
fsTopMost FormStyle form.
1.71 + Renamed main unit ColorBtn.pas to DFSClrBn.pas to avoid conflict
with an existing unit from another author. You will need to modify
the uses clauses in your units that use ColorBtn. Sorry.
1.70 + Added OtherBtnCaption property to allow you to change the caption
of the "Other" button that appears on the color palette. Good for
folks who don't want English text on their buttons (oops). Thanks
to Kerstin Thaler for this.
+ OtherColor property was never set to the palette, only retrieved.
1.66 + Fixed problem with the arrow not drawing correctly on some machines.
I don't know what is causing it, but I've switched over to using a
bitmap so it shouldn't be a problem any more. The ARROW_DRAWING_BUG
define no longer exists.
1.65 + Added OnColorChange event.
+ One person has reported that the arrow on the button does not appear
to be drawn correctly. I can not duplicate this problem, but if the
arrow appears incorrectly for you, try enabling ARROW_DRAWING_BUG
define at the top of COLORBTN.PAS.
1.60 + Upgraded the property editor for PaletteColors and CustomColors so
that it supports multiple selections.
+ Updated for new DFS.INC file, component tab name, history/comments
file.
1.50: + Added published properties PaletteColors and CustomColors, and
a property editor so they can be set at design time.
+ Added automatic saving of custom colors (the ones the user sets in
the dialog). Just fill in the CustomColorsKey (D2/D3) or the
CustomColorsINI (D1). Leave it blank to not save them.
1.00: + Initial release.