 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jean Pion Guest
|
Posted: Mon Feb 13, 2006 4:03 pm Post subject: Switch betweem two dfm files |
|
|
Dear readers,
For some project I need to have two apearances of the same dialog.
Currently I have a file HandleDlg.dfm which defines how the dialog looks
like.
And I have a file HandleDlg.pas which defines how the dialog behaves.
Is there a simple way that I can have an extra dfm, say FancyHandleDlg.dfm,
which shows the dialog a bit different, and switch in code which appearance
to use.
Otherwise I have to duplicate *.pas as well. Which appears a bit silly, but
will work.
Please advice, Jean. |
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Mon Feb 13, 2006 8:03 pm Post subject: Re: Switch betweem two dfm files |
|
|
In article <43f09e7f (AT) newsgroups (DOT) borland.com>, Jean Pion wrote:
| Quote: | For some project I need to have two apearances of the same dialog.
Currently I have a file HandleDlg.dfm which defines how the dialog looks
like.
And I have a file HandleDlg.pas which defines how the dialog behaves.
Is there a simple way that I can have an extra dfm, say FancyHandleDlg.dfm,
which shows the dialog a bit different, and switch in code which appearance
to use.
Otherwise I have to duplicate *.pas as well. Which appears a bit silly, but
will work.
|
The VCL (and the IDE) requires that the DFM file for a form has the same
filename as the unit it belongs to. What you can do, however, is to create a
base class for the dialog that implements the common behaviour with the common
controls (or none), then derive two new form classes from this base class,
using visual form inheritance. These two classes each have their own DFM file.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be |
|
| Back to top |
|
 |
Joe Bain Guest
|
Posted: Mon Feb 13, 2006 8:03 pm Post subject: Re: Switch betweem two dfm files |
|
|
Jean Pion wrote:
| Quote: | Dear readers,
For some project I need to have two apearances of the same dialog.
Currently I have a file HandleDlg.dfm which defines how the dialog
looks like. And I have a file HandleDlg.pas which defines how the
dialog behaves.
Is there a simple way that I can have an extra dfm, say
FancyHandleDlg.dfm, which shows the dialog a bit different, and
switch in code which appearance to use.
Otherwise I have to duplicate *.pas as well. Which appears a bit
silly, but will work.
Please advice, Jean.
|
Look at CreateNew and ReadComponentResFile in the help.
--------------
Joe Bain
www.iegsoftware.com |
|
| Back to top |
|
 |
Jean Pion Guest
|
Posted: Wed Feb 15, 2006 2:03 pm Post subject: Re: Switch betweem two dfm files - Thanks |
|
|
Thanks Joe and Peter,
that's what I needed.
Jean
"Jean Pion" <jean_pion (AT) hotmail (DOT) com> schreef in bericht
news:43f09e7f (AT) newsgroups (DOT) borland.com...
| Quote: | Dear readers,
For some project I need to have two apearances of the same dialog.
Currently I have a file HandleDlg.dfm which defines how the dialog looks
like.
And I have a file HandleDlg.pas which defines how the dialog behaves.
Is there a simple way that I can have an extra dfm, say
FancyHandleDlg.dfm,
which shows the dialog a bit different, and switch in code which
appearance to use.
Otherwise I have to duplicate *.pas as well. Which appears a bit silly,
but will work.
Please advice, Jean.
|
|
|
| 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
|
|