* * *

Author Topic: 1.6.4 form oncreate issue?  (Read 420 times)

snorkel

  • Hero Member
  • *****
  • Posts: 693
1.6.4 form oncreate issue?
« on: March 07, 2017, 11:47:37 pm »
I looked in the release notes and did not notice anything, but I compiled one of my apps with 1.6.4 and I noticed that the oncreate event for the forms is not behaving the same as before, it seemed in prior releases that the oncreate was the first thing to fire, now objects on the form are being created first before the oncreate fires.

or it's an issue with tcombobox firing the onchange event with no items to add.

Not sure yet, but the app ran fine yesterday when built with 1.6.2.


***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 1.6 and FPC 3.0
OS: Windows 10 64 bit and NetRunner Rolling

mangakissa

  • Hero Member
  • *****
  • Posts: 644
Re: 1.6.4 form oncreate issue?
« Reply #1 on: March 08, 2017, 11:01:28 am »
FormCreate is not the same as OnCreate. The first is a procedure, the other a constructor.
So Lazarus is doing exactly what it must do.
Lazarus 1.6 (32b) / FPC 3.0
Windows Vista /  10

Pascal

  • Sr. Member
  • ****
  • Posts: 320
Re: 1.6.4 form oncreate issue?
« Reply #2 on: March 08, 2017, 11:21:41 am »
... now objects on the form are being created first before the oncreate fires.

That has always been the case for OnCreate. Nothing new here.
laz trunk - fpc trunk 32bit - Windows 10 Pro x64

snorkel

  • Hero Member
  • *****
  • Posts: 693
Re: 1.6.4 form oncreate issue?
« Reply #3 on: March 08, 2017, 02:52:36 pm »
Well, the behavior is different than 1.6.2...
I am talking about the oncreate handler for a form, when you double click on it in the events tab it creates a handler called formcreate or similar and the order that it's being called is different.

Just reporting what I have observed,  it could be some other changes in 1.6.4 that are causing it like the combo box onchange firing with no items added.  I will dig more into it today.
Bottom line is the code worked yesterday and for years going through each release of Lazarus.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 1.6 and FPC 3.0
OS: Windows 10 64 bit and NetRunner Rolling

snorkel

  • Hero Member
  • *****
  • Posts: 693
Re: 1.6.4 form oncreate issue?
« Reply #4 on: March 08, 2017, 04:58:26 pm »
Well, I got it working.
turned out it was something with the tdatetime picker control.
I have it sharing it's onchange with some comboboxes and it's onchange was firing before the forms oncreate event.
I had to uncheck it's DefaultToday property to stop it from firing it's onchange.  Once I did that the app works like it did before.

I don't think that property is new, so it still could be the forms oncreate is not firing first.  I don't have time to dig into in further so let's just keep in mind this is just behavior I observed after upgrading to 1.6.4
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 1.6 and FPC 3.0
OS: Windows 10 64 bit and NetRunner Rolling

Bart

  • Hero Member
  • *****
  • Posts: 2596
    • Bart en Mariska's Webstek
Re: 1.6.4 form oncreate issue?
« Reply #5 on: March 08, 2017, 05:13:15 pm »
turned out it was something with the tdatetime picker control.
I have it sharing it's onchange with some comboboxes and it's onchange was firing before the forms oncreate event.
I had to uncheck it's DefaultToday property to stop it from firing it's onchange.  Once I did that the app works like it did before.

Pease file a bugreport about that (and attach a minimal testcase).

Bart

snorkel

  • Hero Member
  • *****
  • Posts: 693
Re: 1.6.4 form oncreate issue?
« Reply #6 on: March 08, 2017, 05:42:24 pm »
ok, if I have time.
I just compiled another app that uses the tdateedit control and had to uncheck the defaulttoday property, so that two instances of it so far.
I always set the current date in the forms oncreate so maybe that property is new?
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 1.6 and FPC 3.0
OS: Windows 10 64 bit and NetRunner Rolling

Bart

  • Hero Member
  • *****
  • Posts: 2596
    • Bart en Mariska's Webstek
Re: 1.6.4 form oncreate issue?
« Reply #7 on: March 08, 2017, 06:01:33 pm »
IIRC then the old behaviour with DefaultToday was that it set the date to the date the program was built, which was rather odd.
It now forces a correct date in the control in TDateEdit.Loaded.
This can force the text to be changed.

Bart
« Last Edit: March 08, 2017, 06:08:46 pm by Bart »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus