Recent

Author Topic: OnChange not fired by code changes of value. Alternatives?  (Read 27519 times)

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #15 on: December 01, 2012, 12:15:26 am »
Is this is not fixed, yet? I have found that on windows, on change will not fire all of the TFloatSpinEdits. I am using Version 1 RC2. So, did they get this thing fix or not? I have 6 on a form and all of them will not update as the data changes. A bug?
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #16 on: December 01, 2012, 07:57:27 am »
Seems to update as far as i see. However on some components (maybe this included), OnChange doesn't trigger if you set its new value same as its old. In this case you may call the OnChange event manually yourself. I assume you just want to update some labels or something based on its value.

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #17 on: December 02, 2012, 07:37:40 pm »
Thanks for telling me to eject the .exe file. It's big 14M! I have no idea what is going on but the OnChange is not working properly. Maybe you can look at it and tell me why this is not working. Notice when you click on DMS(sec), it updates!

So, did they fix it or is it a bug?
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #18 on: December 02, 2012, 10:24:29 pm »
All fields update immediately when i type. I don't see any bug. I'm using fpc 2.7.1 and Lazarus newer than 1.1.

(And Windows 7 - 32bit)
« Last Edit: December 03, 2012, 10:10:17 am by User137 »

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #19 on: December 02, 2012, 10:51:05 pm »
That is not what I am getting using Windows 7 as well as XP Laz 1.0 R2. Let's pass this around and find out if there is a bug in Laz 1.0 R2 because IT DOES NOT UPDATE IMMEDIATELY. Are you using Lin or Win?
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #20 on: December 02, 2012, 11:13:43 pm »
Just to prove it does not update I have ran the program and have snap a pic of the screen and this is what I see. Now when I switch to the TSpinFloatEdit that is 0.00 and then switch away from it, it then updates. There is a bug somewhere. Where? and how do I get ride if it?
By the way,
Version#: 1.0 RC2
Date: 2012-08-21
FPC Version: 2.6.0
i386-win32-win32/win64
« Last Edit: December 02, 2012, 11:25:11 pm by TurboFast »
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #21 on: December 03, 2012, 06:34:37 am »
I just updated Lazarus to:
Version#: 1.04
Date: 2012-11-30
FPC Version: 2.6.0
i386-win32-win32/win64

still the same problem. I am beginning to think that Lazarus has junk components that are not working properly. I am still having problems with another one of Lazarus' components but is off topic with this issue. So, if anyone has any ideas on why OnChange not fired by code changes of value, let me know.
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #22 on: December 15, 2012, 11:42:35 pm »
Uhhh. Bad to start out with that.

The on change is working fine. Multiple calls to the TFloatSpinEdit as in program TempLat.zip does not work in Lazarus in FPC 2.6.0. For some reason, as I have stumbled onto some bug (I believe) in that version of the compiler that was fixed. TempLat.zip does work in FPC 2.6.1 or above.

If you are a newbie and using FPC 2.6.0, I'd update fast because after I updated, all of those other problems in the other component are now working fine. I have no idea what bug was in FPC 2.6.0 but a few thing were causing some major problems for me.

So, if anyone would like to explain what bug it was and why TempLat works in FPC 2.6.1 and not in FPC 2.6.0 here is your chance.
Feel free.

I would like to thank a particular developer for putting me on the correct track.
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

BlueIcaro

  • Hero Member
  • *****
  • Posts: 832
    • Blog personal
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #23 on: December 16, 2012, 12:08:43 am »
Hi, on my Lazarus 1.04 oficial release, I wrote:
Code: Pascal  [Select][+][-]
  1.  
  2. procedure TForm1.FloatSpinEdit1Change(Sender: TObject);
  3. begin
  4.   Form1.Caption:='Onchange'+FloatToStr(FloatSpinEdit1.Value);
  5. end;
  6.  
  7. procedure TForm1.Button1Click(Sender: TObject);
  8. begin
  9.   FloatSpinEdit1.Value:=99;
  10. end;
  11.  
And if It works
/BLueIcaro

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #24 on: December 16, 2012, 12:25:34 am »
I believe I know who you are and the famous button click. Yes, it works fine, now. Just don't know why those darn bugs do what they do. So, how long does it take to get a special feature request?
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #25 on: December 16, 2012, 08:17:03 am »
I believe I know who you are because I read your bug report.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #26 on: December 16, 2012, 09:33:43 pm »
Newbies should never discover bugs like these. I just would like a suspect bugs forms, in these forms. That will give a chance to discuss (for the newbies) if it is a bug or not and if it was patched before running off to file a bug report (and maybe the newbie doesn't know how to explain the bug). This was a bug but was patched but I did not know it was patched. FPC 2.6.1 also clear up some other issues with Lazarus. This bug may have never been an onchange problem. I still don't know what problem it was other then it wasn't working. One person says "yes" and another says "no" while I know what I saw. Hey, don't believe me, do the test yourself, download TempLat.zip and then run it in Laz FPC 2.6.0.
It's weird, totally weird, that's all I can say. I have spent hours trying to figure it out but was one hundred percent sure it was a bug.
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #27 on: December 17, 2012, 12:05:56 pm »
I sympathize with your problems having had them myself often enough.

That said, as I and others said multiple times on this forum, please feel free to discuss possible bugs on this forum by uploading a zip with all sources of a test program that demonstrates your problem.

That's what these forums are for - they are there to help people find out if problems are in their code or in the compiler etc. That's why we always ask to specify compiler/Lazarus version and operating system etc (see my sig).
Just post the program in the most appropriate subforum...

As for the test program: TBH I have no time or interest to have a look after having read the bug report*) but being a newbie myself in many ways I would advise you to:
1. Not assume too quickly the compiler/IDE has a bug
2. If you do think you did fid a bug, create a minimal test program and discuss that on the forums. Perhaps your idea of how the compiler/IDE should work is wrong.

*) AFAIR, you did not provide a minimal test program; one of the devs did and it worked. The devs also closed the issue with your consent..!?!?

Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Bart

  • Hero Member
  • *****
  • Posts: 5675
    • Bart en Mariska's Webstek
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #28 on: December 17, 2012, 12:19:57 pm »
*) AFAIR, you did not provide a minimal test program; one of the devs did and it worked. The devs also closed the issue with your consent..!?!?

Indeed, I did that, and I also wrote the test-case, which also works with fpc 2.6.0 b.t.w.

Bart

TurboFast

  • New Member
  • *
  • Posts: 24
Re: OnChange not fired by code changes of value. Alternatives?
« Reply #29 on: December 17, 2012, 07:45:14 pm »
I have a question about a "minimal test program". I feel like TempLat is a test program even though everyone says that it is not. Ok, it is not a test program. What test program should I have written to demonstrate that the FPC 2.6.0 has a problem and what should I have called this problem. Is it an Onchange problem or what? Really, I do not know. High strangeness? Can you even file a bug report with High strangeness?
Certainly, I would not file a bug report with flying elephants in it but if "YOU" were a newbie and "YOU" had a problem like this and there was no FPC greater then 2.6.0, what would you do? What bug report would you file? What test program would you file for this weirdness in the FPC?

I did make a mistake here. My mistake was not trying to figure out how to upgrade the compiler to a later version. USER137 said that it worked and was puzzled by what the problems was. I thought he was nuts because he said that it worked while another person in the forms said that it did not work (I don't want to say who) but it turns out that USER137 was right as well as the other person depending upon the FPC version.

So, it's time to educate the newbies here. What do you file to demonstrate that the FPC is working wacky if there was no FPC greater then 2.6.0?
« Last Edit: December 17, 2012, 07:52:48 pm by TurboFast »
FPC 2.6.1/i386-Win32-win32/64 on Windows 7 64 & FPC 2.6.1/i386-Win32 on Windows XP 32

 

TinyPortal © 2005-2018