📄 gradform.txt
字号:
needed if compiling under Delphi, but won't hurt either (the cast
doesn't generate any extra compiled code).
+ Fixed some problems in the banded gradient painting code that
effected only those of you writing descendant classes. Many thanks
to Joe White for finding and fixing these.
1.90: + Added UseDithering property. If true, and in a high color mode,
a dithering mask will be used to draw the gradient. This method
is better than the old because it doesn't have the "banding" effect.
The code this is based on was sent to me by Tamas Demjen, many thanks
to him. If you want to read a good article discussing this, see his
web site. The article is at
http://members.xoom.com/demjen/builder/gradient.html.
1.83: + Using the OnCaptionPaint event caused the caption font handle to
be deleted, resulting in the system font getting used. Thanks to
Joe White for finding and fixing this.
+ Minimized MDI child forms had their restore caption button drawn as
minimize buttons. Thanks to Huub Schaeks for finding and fixing
this.
+ There was some annoying flicker on form creation when the form
inheritance was being used. Thanks to Huub Schaeks again for finding
and fixing this one, too.
1.82: + Stupid programmer (me) thought BorderWidth was in all versions of
Delphi & Builder. It's not; it's D4 only. v1.81 would only compile
under D4. Fixed.
1.81: + If BorderWidth had a value other than zero, you would get an
unpainted area around the form.
1.80: + Added CaptionFont and UseSystemCaptionFont property. If
UseSystemCaptionFont is true, CaptionFont is ignored. Otherwise,
CaptionFont is used for the text in the caption bar. The color of
the CaptionFont property is ignored, and the CaptionTextColor and
InactiveCaptionTextColor properties are still used for this as always.
Also, the Size property of CaptionFont has no effect, either. This
is because you really wouldn't want to try to account for how big the
user's caption bar is and adjust your font size for that in code.
Instead, I just built it into the class. Of course, if you pick a
font that doesn't support a lot of sizes (i.e. non-TTF), you could
still end up with a font that doesn't fit well.
+ Gradient looked bad on 16-color systems. There's no really good way
of doing a gradient with the basic 16-colors available on these
systems, so by default the gradient won't be painted now on these
systems. If you find some reason to go ahead and do it, you can
override this behavior by using the new public property Paint16Color.
+ OnCreate event was being called twice (once before constructor, once
after) in C++Builder apps. Fixed so that it now behaves the same
as a regular TForm (i.e. OnCreate called after constructor).
+ UseWin98Gradient property has been extended to also mean "use NT 5
gradient". I should probably rename it, but that would break
existing DFM files, and the name would probably be really silly, too.
Maybe I'll rename it to "UseSystemGradient" in the next major version.
1.72: + If the system menu Close item was disabled (via CS_NOCLOSE class
window style, for example) the close caption button was not drawn
in the disabled state.
1.71: + Fixed bug that would cause OnCreate to be called twice in Delphi 4
if the OldCreateOrder property were set to FALSE. Thanks to Pepe
Lazo <info@servosis.com> for finding and fixing this.
1.70: + Fixed "unresolved external" linker errors in C++Builder. If you are
interested in the details, search for "DFS_HDC" in the source.
+ Added real IDE experts (see GradFormReg.pas) for proper design-time
support of the new properties. This removes all the old fooling
around with the object repository you had to do to install this thing
in previous versions. If you have installed a previous version of
this, you can, and should, now delete that old entry from the object
repository. You now use the items on the DFS tab of the object
repository to create new TdfsGradientForms. Please read the
installation section above for complete details of what old files
should be removed/deleted.
+ Delphi 4 compatibility.
1.62: + Cut and paste error in the SetGradientInactiveStopColor method. Did
not properly track whether the system default inactive color was
being used or not. Thanks to Pepe Lazo for pointing the erroneous
code out to me and providing a fix.
+ System icon now always paints in design-time. Thanks again to Pepe
Lazo for catching and fixing.
+ Caption font was created too soon and in the wrong place.
BorderStyle values of bsToolWindow and bsSizeToolWin would use the
big (normal) font. Thanks yet again to Pepe Lazo for catching this.
+ Moved the following methods from private to protected visibility and
made them virtual: DrawCaption, GetCaptionRect DrawCaption,
PaintMenuIcon, FillRectSolid, FillRectGradient, PaintCaptionText,
PaintCaptionButtons. More friendly to those who want to descend from
the class.
1.61: + Fixed problem with changing a form's Caption property in the
OnShow, OnActivate and/or OnDeactivate events. Caused some nasty
screen painting problems.
1.60: + Known issues section updated, don't forget to check it.
+ Added Version property.
+ Added UseWin98Gradient property. Setting to TRUE will effectively
disable all TdfsGradientForm code if the app is being run on a Windows
98 system. This is to let Win98 provide the gradient while still
allowing your app to do the gradient on Win95/NT systems. It
*should* catch NT 5.0 systems as well, but I've not tested that so
I can't swear to it.
NOTE: Because I have to recreate the window handle when you change
the value of this property, the form is going to disappear from the
IDE. I can't find a way to force the IDE to redisplay the form, so
you will have to manually press F12 to redisplay it after changing
the property value. However, this does not happen at run-time so you
don't need to do anything special in code.
+ Changing the system caption color would only cause non-MDI child
forms to updated their colors. Fixed.
+ Changing the caption of an MDI child TdfsGradientForm in its OnActivate
and/or OnDeactivate method would cause very nasty painting problems
when it overlapped other MDI children. Fixed.
+ Added three new related properties: GradientInactiveStartColor,
GradientInactiveStopColor, and InactiveCaptionTextColor. As you
might guess (unless you've been bashing your head between two bricks
for more than an hour a day), they work exactly the same as
GradientStartColor, GradientStopColor and CaptionTextColor except
they apply when the window is inactive (not focused).
1.56: + The gradient could become somewhat distorted if in high color mode
and the caption was wider (in pixels) than the GradientColors value.
It now uses the low color painting method in this case which is
slower, but does not have the distortion. Thanks to Jim Burns
(jimburns@technologydynamics.com) for catching this.
+ C++Builder 3.0 compatible.
1.55: + I goofed on when the GradientStopColor was stored. It ended up such
that you could not change the GradientStopColor at design time.
+ Fixed problem that would cause the text that showed up in the task
switch window (Alt-Tab) to be incorrect if you changed the Caption
property from its design-time value. An unexpected bonus from this
fix was that it cleared up the maximized MDI child flickering problem
as well. :)
+ Compatible with C++Builder 1.0.
1.54: + Caption buttons had a few problems. Min/max buttons weren't being
drawn disabled when they should, and help button didn't always show
up when it should.
1.53: + Drawing minimize/maximize caption buttons when I shouldn't have been.
+ Design-time drawing bug fixed.
1.52: + Fix for WM_SYSCOLORCHANGE in last version wasn't exactly right.
+ Now includes a help file!
1.51: + Wasn't properly responding to WM_SYSCOLORCHANGE message anymore.
+ Updated for new DFS.INC file, component tab name, history/comments
file.
1.50: + Added Register procedure so you can get at the published stuff and
see it in action at design-time under Delphi 3! Sorry, previous
versions of Delphi and C++Builder do not support this.
1.16: + Problem with MDI children that were maximized when they did not
take up entire client area.
1.15: + Nasty little bug in MDI apps with child controls.
+ Got the system menu problem fixed so that the paint problem isn't
visible the entire time the menu is up. Now it just flashes. :(
+ WindowMenu items were not properly displaying MDI child captions.
To fix this, I had to re-introduce a flash in the caption every
time the Caption property is changed in an MDI child at run-time.
1.14: + Made CalculateColors a virtual protected method.
+ Three new properties:
GradientStartColor and GradientStopColor to use other than the
default gradient colors. These were added by William O'Connell
<woc@A.crl.com>, many thanks to him.
CaptionTextColor to change the color of the caption text.
+ There's some sort of bug in the Windows non-client paint stuff
that is causing the non-client area to be painted when the left
mouse button is clicked in it. That's not so bad, except that it
paints under the caption buttons in the default system color.
I've added a handler for this and WM_SYSCOMMAND (don't ask) and
repaint it as soon as I can, but you still see a flash when you
click on the border, and you see it the whole time that the system
menu is displayed. Please email me if you have any ideas on this.
1.13: + Fixed an off-by-one error in caption button painting. Thanks to
Robert Galle for this one.
1.12: + Another MDI bug. If the MDI child form is not a TdfsGradientForm
descendant, the caption text will not update if the child is
maximized and the child's caption text is changed. There is a
work-around for this, but it causes an annoying flicker which I
can not stand. If you can stand it, look at the GradClientWndProc
method and uncomment the code there. The better solution, I
think, is to make your MDI child form's a descendant of
TdfsGradientForm. For those of you who want your app to be "just
like Word", you can use the new FPaintGradient property (below)
so that the child windows are never painted with a gradient. This
solution doesn't suffer from the flicker problem.
+ Changed FGradientOnInactive boolean property to FPaintGradient set
property. Three possible values: gfpAlways, gfpActive and
gfpNever.
+ Cleaned up some code that was now longer necessary. May have sped
up the paint time by a nanosecond or two. :)
1.11: + Fixed problem for people who want gradient MDI child windows.
+ MDI child caption text changing at runtime when child window was
maximized would not update caption text. Fixed.
+ Got rid of some of the old painting code that wasn't used, as it
didn't work very well anyway. There are now two painting routines
(FillRectGradientHigh, FillRectGradientLow) for high color mode
and 256 or less color mode. The former is faster, but doesn't
work on less than high color mode (16-bit depth) because it is
"palette stupid".
1.10: + Fixed problem that could cause the caption to be painted all black
when first created.
+ Added OnPaintCaption property. Makes event available to paint on
the caption after the gradient, icon, and buttons have been drawn,
but before the text is. See demo program for example of use.
1.04: + Found a way to get a nice 16x16 version of the icon. Icon is now
drawn much better than before.
1.03: + Fixed problem with redrawing inactive window when
GradientOnInactive set to FALSE.
+ Fixed problem of gradient disappearing if Caption set at run-time.
+ Fixed all the MDI bugs that I know about.
+ Gradient would goof up in some cases where window was sized very
small horizontally. Fixed.
+ Fiddled with the button drawing some more and I think the sizes
are finally right under all circumstances.
+ Didn't recreate the caption font if the user changed it.
(WM_SETTINGCHANGE) I knew about this one for a while, just kept
fogetting to fix it...
+ Resizing window so that it was too small for the caption text to
fit in the available space caused it to write under the buttons.
It now properly substitutes ellipsis ("...") if the string won't
fit. I was dreading this one until I found that the Delphi Win32
docs don't document a DrawText flag (DT_END_ELLIPSIS) that will
do this for you automagically. Happy day. :)
1.02: + Added some new painting routines. They are controlled below with
the conditional defines PAINT-OLD-WAY, STRETCH-WITH-BRUSH and
STRETCH-WITH-PEN. Please experiment with them and tell me which
you find to be the fastest.
1.01: + Fixed the inactive flashing when GradientOnBackground is set. It
helps if you read the docs instead of assuming you know what it
says.... grr....
+ Fixed problem with incorrect button drawn on maximized windows.
Now correctly draws restore button if window is maximized.
+ Redid button size code. Should be right now, but still not 100%
sure. The GetSystemMetrics return values don't seem to be correct.
1.00: + Initial release
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -