TAdvMsgBox component Version 1.0
Table of Contents
1. Credits and Disclaimer
2.
Purpose
3.
Supported Delphi versions
4.
How to Use
5.
Release Notes
1. Legal
Stuff
TAdvMsg was written by Sven
Künzler
<svenk@gmx.net>
If you understand german language you might want to visit my homepage at http://www.xwatch.de/.
If you speak english there is an english version of my Delphi pages at http://www.xwatch.de/en/delphi/.
Disclaimer:This product is
released as public domain, which means:
I make no
restrictions about using it and you
do not expect any guarrantees from me.
[Top]
TAdvMsgBox
provides an easy way to memorize a user's decision.
If the message starts nagging him, he can mark the checkbox. The TAdvMsgBox
will save the result of the message box to the registry. If the program subsequently Execute
's the message box, it will not be shown but the result saved to the registry will be used.
[Top]
TAdvMsgBox was designed for Delphi
5.0. However, it should work with D3 and D4 with little/no
changes. The only requirement is the existence of the
CreateMessageDlg
. As this is not the case for Delphi 2.0,
it won't work for Delphi 2.0.
[ Top]
Drop the TAdvMsgBox
component on a form. You can control its behavior by the following properties:
Behavior
controls the meaning of the checkbox. ambShowUnchecked
means that the message box will be shown if the checkbox is unchecked. Alternatively, you can set it to ambShowChecked
. That would mean that the message box pops up if the checkbox is (guess what!) checked.
Buttons
determines which possible buttons to show. This is a TMsgDlgButtons
parameter which you would also pass to a MessageDlg
call.
CBoxCaption
sets the caption of the checkbox.
CBoxChecked
indicates whether the checkbox is checked by default.
Name
is the components name. Please note that this has also meaning for for the name of the values saved to the registry.
RegKey
points to the key in the registry where the settings should be saved. If the key is not existing it will be create. Please note that there will be two values stored in this key.
Suppose the Name
of the component is AdvMsgBox1. This would mean that the following values to be created:
Execute
call.
AdvMsgBox1
on different Form
s. In this case, you should give each of them an own RegKey
where to store its results. Otherwise, one component will override the results of the other.
Tag
is a standard property of Delphi components.
Text
contains the message body.
Title
contains the dialog's title.
The actual action of TAdvMsgBox
is controlled by two methods:
Execute
finally shows the message box.
DeleteRegEntries
clears the values stored in the registry. If called before Execute
it makes shure that the message box is shown.
[Top]
This is the first release of this component. It was written on one single evening, so you should not expect it to be bullet-proof. There may be "issues" that have to be fixed.
Furthermore, there are several additional features I can think of:
So, if you find bugs in the component or make improvements to it, please mail it to me.
Have fun,
Sven Künzler
Reessum, 20.09.99
[
Top]