Recent

Author Topic: Maybe Strange behaviour...  (Read 1234 times)

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Maybe Strange behaviour...
« on: July 08, 2024, 02:54:39 am »
I am using a counter on every form that increases the certain value (lets call it Tag).
When is show (in the on show-event) a from this Tag is increased by one.
And depending on this Tag certain things happen on that form.


So far so good.


Next I set the previous form (the form that calls the next form) to fsNormal and the form that is called up to fsStayOnTop.


On my Mac the this works perfectly.
But when I run the same code on a windows machine the Tag is increased by one every time I change the form status.


Can anyone confirm this so we can make a bug report?





You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Bart

  • Hero Member
  • *****
  • Posts: 5716
    • Bart en Mariska's Webstek
Re: Maybe Strange behaviour...
« Reply #1 on: July 08, 2024, 02:45:31 pm »
You mean that changing FormStyle causes an OnShow event?
If so, please file a bugreport.

Bart

mercurhyo

  • Sr. Member
  • ****
  • Posts: 265
Re: Maybe Strange behaviour...
« Reply #2 on: July 08, 2024, 02:57:33 pm »
simple logic
I suggest to use TForm.BringToFront and its opposite TForm.SendToBack instead of using fsStayOnTop and fsNormal that are not opposite eachother
DEO MERCHVRIO - Fedora PlasmaKDE, Win11pro - Ryzen9XT+Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Maybe Strange behaviour...
« Reply #3 on: July 08, 2024, 04:05:41 pm »
You mean that changing FormStyle causes an OnShow event?
If so, please file a bugreport.

Bart
Yes but I want it confirmed before I add a bugreport
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Bart

  • Hero Member
  • *****
  • Posts: 5716
    • Bart en Mariska's Webstek
Re: Maybe Strange behaviour...
« Reply #4 on: July 08, 2024, 04:42:20 pm »
If changing the formstyle also changes which form becomes active, then an OnShow is to be expected, if the same form remains active then it would be a bug (or at least the behaviour across WS is not the same).

Bart

madref

  • Hero Member
  • *****
  • Posts: 1116
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Maybe Strange behaviour...
« Reply #5 on: July 08, 2024, 07:46:10 pm »
That is why I am asking if someone can confirm this behaviour
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Main Platform:
--------------
Mac OS X Tahoe 26.2
Lazarus 4.99 (rev main_4_99-3149-g7867f6275c) FPC 3.3.1 x86_64-darwin-cocoa

Windows 10 Pro
Lazarus 3.99 (rev cbfd80ce39)

Thaddy

  • Hero Member
  • *****
  • Posts: 19143
  • Glad to be alive.
Re: Maybe Strange behaviour...
« Reply #6 on: July 09, 2024, 09:58:24 am »
That is why I am asking if someone can confirm this behaviour
Well, there are great differences between widget sets. I would not say inevitable or unsolvable, but using widget set particular things may put your expectations on the wrong path.
In general, instead of the dreaded tag that I wrote about this week, simply keep some global variable, a class variable or inherit a new class. Tags are evil.
objects are fine constructs. You can even initialize them with constructors.

BrunoK

  • Hero Member
  • *****
  • Posts: 766
  • Retired programmer
Re: Maybe Strange behaviour...
« Reply #7 on: July 09, 2024, 11:16:03 am »
That is why I am asking if someone can confirm this behaviour
Maybe you could publish (Menu / Project / Publish project ...) a minimal project that show behavior you consider erroneous.

 

TinyPortal © 2005-2018