Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Subclassing TSpinEdit



Permlink Replies: 4 - Last Post: Oct 17, 2017 11:11 PM Last Post By: Peter Below
Karl-Heinz warn...

Posts: 22
Registered: 10/21/00
Subclassing TSpinEdit
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2017 10:19 PM
This Question was ask also some days early in the Component weriter
forum, no response

Hi,

I would like to build a new SpinEdit with the possibility to show the
ASCII Char belonging to the value. For example the Value is 61dez and
the SpinEdit should show the "A".

Therefore I must in a Subclass (MySpinEdit) overwrite the Methods
GetValue and SetValue. But this are private in TSpinEdit.

Is there another possibility other then change the original source?

If no, how can I rebuild the changed Package dclsmp250 (Samples) and
what is with vclsmp/vclsmp250?

Thanks for help

Karl-Heinz

Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Subclassing TSpinEdit
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 16, 2017 11:02 PM   in response to: Karl-Heinz warn... in response to: Karl-Heinz warn...
Karl-Heinz warnkoenig wrote:

This Question was ask also some days early in the Component weriter
forum, no response

Hi,

I would like to build a new SpinEdit with the possibility to show the
ASCII Char belonging to the value. For example the Value is 61dez and
the SpinEdit should show the "A".

Therefore I must in a Subclass (MySpinEdit) overwrite the Methods
GetValue and SetValue. But this are private in TSpinEdit.

Is there another possibility other then change the original source?

If no, how can I rebuild the changed Package dclsmp250 (Samples) and
what is with vclsmp/vclsmp250?

Your best bet is to simply make a copy of the original component unit,
rename the unit and the component, modify it as you need, then install
it into a design-time package of your own. Leave the original sample
component and the design-time package for it alone.

--
Peter Below
TeamB
Karl-Heinz warn...

Posts: 22
Registered: 10/21/00
Re: Subclassing TSpinEdit
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 17, 2017 11:30 AM   in response to: Peter Below in response to: Peter Below
Am 17.10.2017 um 08:02 schrieb Peter Below:
Karl-Heinz warnkoenig wrote:

This Question was ask also some days early in the Component weriter
forum, no response

Hi,

I would like to build a new SpinEdit with the possibility to show the
ASCII Char belonging to the value. For example the Value is 61dez and
the SpinEdit should show the "A".

Therefore I must in a Subclass (MySpinEdit) overwrite the Methods
GetValue and SetValue. But this are private in TSpinEdit.

Is there another possibility other then change the original source?

If no, how can I rebuild the changed Package dclsmp250 (Samples) and
what is with vclsmp/vclsmp250?

Your best bet is to simply make a copy of the original component unit,
rename the unit and the component, modify it as you need, then install
it into a design-time package of your own. Leave the original sample
component and the design-time package for it alone.

Ok, but what shall I do for the next Delphi Verion? All year I have
then to modify the copy again?

A second question to this problem. I found diferent Names of the
Runtime-Lib. There are vclsmp/vclsmp250. Is ther some automatic for
some type of files?
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Subclassing TSpinEdit
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 17, 2017 11:44 AM   in response to: Karl-Heinz warn... in response to: Karl-Heinz warn...
Karl-Heinz warnkoenig wrote:

Ok, but what shall I do for the next Delphi Verion? All year I have
then to modify the copy again?

you should jsut install your modified component into the IDE in hte next
release. Those sample components haven't' changed in years.


A second question to this problem. I found diferent Names of the
Runtime-Lib. There are vclsmp/vclsmp250. Is ther some automatic for
some type of files?

dcp's will not have a suffix for easier porting your packages to the next
release. So you require vclsmp, when you move to the next release no change is
needed for your package when you recompile, but it will not be linking to
vclsmp260 since the vclsmp.dcp will be the 260 one.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Subclassing TSpinEdit
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 17, 2017 11:11 PM   in response to: Karl-Heinz warn... in response to: Karl-Heinz warn...
Karl-Heinz warnkoenig wrote:

Am 17.10.2017 um 08:02 schrieb Peter Below:
Karl-Heinz warnkoenig wrote:

This Question was ask also some days early in the Component weriter
forum, no response

Hi,

I would like to build a new SpinEdit with the possibility to show
the >> ASCII Char belonging to the value. For example the Value is
61dez and >> the SpinEdit should show the "A".

Therefore I must in a Subclass (MySpinEdit) overwrite the Methods
GetValue and SetValue. But this are private in TSpinEdit.

Is there another possibility other then change the original source?

If no, how can I rebuild the changed Package dclsmp250 (Samples)
and >> what is with vclsmp/vclsmp250?

Your best bet is to simply make a copy of the original component
unit, rename the unit and the component, modify it as you need,
then install it into a design-time package of your own. Leave the
original sample component and the design-time package for it alone.

Ok, but what shall I do for the next Delphi Verion? All year I have
then to modify the copy again?

No, you just recompile the package for the new Delphi version, changes
to the code should not be necessary.


A second question to this problem. I found diferent Names of the
Runtime-Lib. There are vclsmp/vclsmp250. Is ther some automatic
for some type of files?

The package files on disk are named with a version suffix for the
Delphi version they are for. When you name a required package in the
requires clause of another package, or in the run-time package list of
an EXE, you can leave off the suffix, the IDE will then automatically
look for a package with its version suffix if it cannot find the
package with the exact name you specified. This way you do not need to
update the package names in these list when you move to a new Delphi
version.


--
Peter Below
TeamB

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02