 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
JD Guest
|
Posted: Thu Jan 29, 2004 9:56 am Post subject: Re: How to integrate TFontDialog with a form? |
|
|
Randall Parker <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote:
| Quote: | [...] I'm wondering what style to use in the UI to support this.
|
That's entirely up to you. What do you want the user to be
able to do? What is it that you think they must do?
| Quote: | Also, I'm trying to figure out whether the TFontDialog
changes the pointer to what TFont object it points to every
time a user invokes the dialog and then selects OK.
|
The dialog consists of (one of it's properties) an actual TFont
that has it's properties set when the user clicks OK.
| Quote: | So then is that TFont object always the same object instance?
|
Yes.
| Quote: | I'm thinking I need to copy from it to a different TFont
object for my own places where I use it since it could
change when the same dialog is used to select other fonts
for other target displayed text.
|
Why not just set the visible object's Font property. The user
gets visual feedback and the font settings are stored so when
you save the settings or display the graph, retrieve the fonts
along with the text.
~ JD
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Jan 29, 2004 7:32 pm Post subject: Re: How to integrate TFontDialog with a form? |
|
|
"Randall Parker" <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
message news:4018ca03$1 (AT) newsgroups (DOT) borland.com...
| Quote: | So what sort of thing to do to allow the user to select that he
wants to set a font? Put a ... button to the right of each TEdit
so the user can click the button to bring up the TFontDialog?
|
Yes. Although the button caption does not necessarily needto be "...", that
is just what the OI chooses to use.
| Quote: | I'm wondering what style to use in the UI to support this.
|
Anything you want. It doesn't even have to be a button, it would be a popup
menu, for example.
| Quote: | Also, I'm trying to figure out whether the TFontDialog changes
the pointer to what TFont object it points to every time a user
invokes the dialog and then selects OK.
|
TFontDialog has its own TFont object that it reuses each time. To apply the
user's settings, you simply Assign() the dialog's Font property to the
destination font when needed.
| Quote: | So then is that TFont object always the same object instance?
|
Yes, in relation to the dialog instance.
| Quote: | I'm thinking I need to copy from it to a different TFont object
for my own places where I use it
|
Yes, you do need to copy the font values (not the pointer itself).
| Quote: | since it could change when the same dialog is used to select
other fonts for other target displayed text. I don't see the point
of instantiating a different TFontDialog for every piece of text
that the user can separately set the font type for.
|
No, you don't need to do that. You could Assign() the dialog's Font prior
to calling Execute() to update the dialog display with the paticular font
into you are modifying, and then copy the new settings back to the original
font object when done.
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|