Recent

Author Topic: Replace TDBZVDateTimePicker components by TDBDateTimePicker  (Read 10758 times)

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Replace TDBZVDateTimePicker components by TDBDateTimePicker
« on: March 07, 2016, 02:11:10 am »
I was using the TDBDateTimePicker components, now I want to replace  TDBZVDateTimePicker.
Replacing components of automatic way?


« Last Edit: March 07, 2016, 02:45:29 am by elidorio »
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4467
  • I like bugs.
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #1 on: March 07, 2016, 02:36:58 am »
I was using the TDBDateTimePicker components, now I want to replace TDBDateTimePicker.

Replace with what?
 
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #2 on: March 07, 2016, 02:46:09 am »
ops!
Per  TDBZVDateTimePicker
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

balazsszekely

  • Guest
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #3 on: March 07, 2016, 06:20:05 am »
@elidorio
You need a find/replace tool(text crawler):
 1. set your project folder
 2. set the filters(*.pas; *.pp; *.lfm)
 3. search for TDBDateTimePicker then replace with TDBZVDateTimePicker.

The whole process shouldn't take more then 5 minutes. After this you should manually change properties/methods there are no longer valid, because of the different component.

PS: Alternatively you can use the built-in Search/Find in files dialog(Shift+Ctrl+F).

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #4 on: March 07, 2016, 06:20:39 am »
There isn't any tool/addin that does that automatically you have to run a search and replace in both pas and lfm files either one by one or with an external text editor
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #5 on: March 07, 2016, 09:01:44 am »
@elidorio
You need a find/replace tool(text crawler):
 1. set your project folder
 2. set the filters(*.pas; *.pp; *.lfm)
 3. search for TDBDateTimePicker then replace with TDBZVDateTimePicker.


3. should be "search for TDBZVDateTimePicker then replace with TDBDateTimePicker."
OR BETTER search for ZVDateTimePicker and replace with DateTimePicker (this will in one move replace all TZVDateTimePickers with TDateTimePickers and all TDBZVDateTimePickers with TDBDateTimePickers, and also will conveniently replace control names on your forms - eg. ZVDateTimePicker1 will become DateTimePicker1).

After this you should manually change properties/methods there are no longer valid, because of the different component.

There shouldn't be any.

Plus, open Project Inspector (Project->Project Inspector in main menu) and remove dependency of ZVDateTimeCtrls package. Then uninstall ZVDateTimeCtrls from the IDE, you will not need it any more.
« Last Edit: March 07, 2016, 09:04:39 am by Zoran »

balazsszekely

  • Guest
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #6 on: March 07, 2016, 09:17:04 am »
Quote
@Zoran
3. should be "search for TDBZVDateTimePicker then replace with TDBDateTimePicker."
If I understood this correctly, he want to replace TDBDateTimePicker with TDBZVDateTimePicker. So he should search for TDBDateTimePicker.
« Last Edit: March 07, 2016, 09:21:21 am by GetMem »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #7 on: March 07, 2016, 09:51:49 am »
Quote
@Zoran
3. should be "search for TDBZVDateTimePicker then replace with TDBDateTimePicker."
If I understood this correctly, he want to replace TDBDateTimePicker with TDBZVDateTimePicker. So he should search for TDBDateTimePicker.
That would be unwise,  TDBDateTimePicker is TDBZVDateTimePicker merged in the lcl it self. I would think that TDBZVDateTimePicker development is halted at this time and every effort is targeted on TDBDateTimePicker.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #8 on: March 07, 2016, 10:07:26 am »
Quote
@Zoran
3. should be "search for TDBZVDateTimePicker then replace with TDBDateTimePicker."
If I understood this correctly, he want to replace TDBDateTimePicker with TDBZVDateTimePicker. So he should search for TDBDateTimePicker.

Perhaps he said that, but then I believe he made mistake.
Anyway, I strongly recommend using controls from DateTimeCtrls package over "ZV" controls.
These are same controls, but when they got included in Lazarus distribution, the name was changed for Delphi compatibility. So, ZVDateTimeControls are no more updated and it is suggested to switch to DateTimeCtrls package which is included in Lazarus (the controls are automatically installed in component palette).

That would be unwise,  TDBDateTimePicker is TDBZVDateTimePicker merged in the lcl it self. I would think that TDBZVDateTimePicker development is halted at this time and every effort is targeted on TDBDateTimePicker.

Exactly.

balazsszekely

  • Guest
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #9 on: March 07, 2016, 10:27:38 am »
@Zoran
I'm not arguing about which component is better. I know you're the current maintainer of TDBDateTimePicker :), I'm also aware that you put a lot of effort lately to make it better(http://forum.lazarus.freepascal.org/index.php/topic,31679.msg203242.html#msg203242). But perhaps the OP has a good reason the switch back to an older, obsolete component, or maybe he has absolutely no idea what he is doing. I was only trying to help him to switch from one component to another...
Anyway, I believe hes has more then enough information know. 

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #10 on: March 07, 2016, 11:27:06 am »
@Zoran
I'm not arguing about which component is better. I know you're the current maintainer of TDBDateTimePicker :), I'm also aware that you put a lot of effort lately to make it better(http://forum.lazarus.freepascal.org/index.php/topic,31679.msg203242.html#msg203242). But perhaps the OP has a good reason the switch back to an older, obsolete component, or maybe he has absolutely no idea what he is doing. I was only trying to help him to switch from one component to another...
I know :)

Anyway, I believe hes has more then enough information know. 
Yes, I agree.

elidorio

  • Sr. Member
  • ****
  • Posts: 295
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #11 on: March 08, 2016, 09:29:44 pm »
To work I had to click on each TDBZDateTimePicker and Change class and switch to TDBDateTimePicker
Lazarus 1.4.4 | FPC 2.6.4 | Windows / Linux Debian

Zoran

  • Hero Member
  • *****
  • Posts: 1830
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #12 on: March 09, 2016, 12:33:00 pm »
To work I had to click on each TDBZDateTimePicker and Change class and switch to TDBDateTimePicker

Couldn't you do what GetMem proposed? Even better, corrected with what I said here:
@elidorio
You need a find/replace tool(text crawler):
 1. set your project folder
 2. set the filters(*.pas; *.pp; *.lfm)
 3. search for TDBDateTimePicker then replace with TDBZVDateTimePicker.


3. should be "search for TDBZVDateTimePicker then replace with TDBDateTimePicker."
OR BETTER search for ZVDateTimePicker and replace with DateTimePicker (this will in one move replace all TZVDateTimePickers with TDateTimePickers and all TDBZVDateTimePickers with TDBDateTimePickers, and also will conveniently replace control names on your forms - eg. ZVDateTimePicker1 will become DateTimePicker1).

After this you should manually change properties/methods there are no longer valid, because of the different component.

There shouldn't be any.

Plus, open Project Inspector (Project->Project Inspector in main menu) and remove dependency of ZVDateTimeCtrls package. Then uninstall ZVDateTimeCtrls from the IDE, you will not need it any more.

As GetMem said, it shouldn't take more than couple of minutes. Anyway, I am sorry for this inconvenience caused by name change, but it would be too much work for me to continue maintaining the same package with different name in parallel. I'll see if I can create a tool which will do this conversion.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #13 on: March 09, 2016, 12:36:48 pm »
To work I had to click on each TDBZDateTimePicker and Change class and switch to TDBDateTimePicker
Couldn't you do what GetMem proposed?
What's wrong with it? That's the way for changing classes provided by Lazarus.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Replace TDBZVDateTimePicker components by TDBDateTimePicker
« Reply #14 on: March 09, 2016, 12:56:57 pm »
To work I had to click on each TDBZDateTimePicker and Change class and switch to TDBDateTimePicker
Couldn't you do what GetMem proposed?
What's wrong with it? That's the way for changing classes provided by Lazarus.
it has to be done for each control instead of once for all.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018