Recent

Author Topic: TageControl some strange only change de size of form and look efect..  (Read 1742 times)

eldonfsr

  • Hero Member
  • *****
  • Posts: 501
Some strange  on tpagecontrol you can see don't show up all component same as design specially on TDBECheckBox...if click on anytab and back to item master show up clear...

in first image is design time second  is show form last after click on any tab an back to Item master...

Why i don't know  some ide what is going here...

 

 

dseligo

  • Hero Member
  • *****
  • Posts: 1365
Re: TageControl some strange only change de size of form and look efect..
« Reply #1 on: August 13, 2024, 12:57:51 am »
Some strange  on tpagecontrol you can see don't show up all component same as design specially on TDBECheckBox...if click on anytab and back to item master show up clear...

in first image is design time second  is show form last after click on any tab an back to Item master...

Why i don't know  some ide what is going here...

Edit: It looks to me that maybe some 'parenting' or aligning problems are in place.
Post minimal complete project that shows your problem and someone will probably find error in matter of hours.
« Last Edit: August 13, 2024, 01:39:16 am by dseligo »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10298
  • Debugger - SynEdit - and more
    • wiki
Re: TageControl some strange only change de size of form and look efect..
« Reply #2 on: August 13, 2024, 08:35:19 am »
Just some random guesses...

1) Check if you have any colors changed for the TDBCheckbox (including font color).

2) there is an overlaying Text, not sure if what that is. Could it be "TMV" from the edit further right?

3) IN OI is a component Tree. Check that all the components are listed inside the Page. You could have a component that is outside the page control, and drawn on top?

4) If you resize the form while the app is running: does it get corrected?

eldonfsr

  • Hero Member
  • *****
  • Posts: 501
Re: TageControl some strange only change de size of form and look efect..
« Reply #3 on: August 13, 2024, 07:32:46 pm »
Here a sample apps to see that look

tetrastes

  • Hero Member
  • *****
  • Posts: 529
Re: TageControl some strange only change de size of form and look efect..
« Reply #4 on: August 13, 2024, 09:29:50 pm »
Your project contains too many extra packages to install. It is quite likely that the problem is in one of them. Try to show your issue without them. 

eldonfsr

  • Hero Member
  • *****
  • Posts: 501
Re: TageControl some strange only change de size of form and look efect..
« Reply #5 on: August 13, 2024, 10:29:56 pm »
Ok i Clean up and only components required..all jvc deleted...
 

dseligo

  • Hero Member
  • *****
  • Posts: 1365
Re: TageControl some strange only change de size of form and look efect..
« Reply #6 on: August 14, 2024, 01:51:18 am »
I stripped down test project further, so it can be compiled without additional components in Lazarus.

I also noticed if I comment line 'TShItemMaster.ImageIndex:=0;' in FormShow method then there is no artefacts.

dseligo

  • Hero Member
  • *****
  • Posts: 1365
Re: TageControl some strange only change de size of form and look efect..
« Reply #7 on: August 14, 2024, 01:58:19 am »
Also, this has something to do with LCL scaling.

I set windows to 125% scaling and make some small change to form (i.e. move non-visual component ImList32) and save the form.
After that, form is showing fine (I noticed that row 'DesignTimePPI = 120' was added lfm, and Height, Top, Left and Width properties of components was changed).

If I return Windows scaling to 100% and rebuild project there is no artefacts. But if I make change to the form and save, artefacts returns.

What version of Lazarus do you have? I tested it with Lazarus 3.4, on Windows 11.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10298
  • Debugger - SynEdit - and more
    • wiki
Re: TageControl some strange only change de size of form and look efect..
« Reply #8 on: August 14, 2024, 01:01:25 pm »
It should be reported as a bug, with the latest zip.
The "dat" file isn't needed (the app seems to create it itself).

Below can be copied to the bug report:


The problem actually (most likely) is not the artifacts. The page doesn't paint it's background.
- In the clean version the background is white
- With the artifacts the background is grey, but when it cleans up (on resize) it becomes white.

So apparently the components are painted on the "not painted" page.

However, there must be something else to it, because it is limited to Checkbox and radio.
- They both are "see through". If you place a radio above a label, you can see parts of the label.
- So are labels too. But labels are TGraphicControl, radios are TWinControl.
- Radio, Checkbox AND TButton have a custom WndProc (and all 3 have the same) that omits "EraseBackground" (otherwise it flickers like hell). For buttons it does not matter, they are not "see through" and do it in paint.

Yet, changing the WndProc ("SubClassWndProc") does not help, not completely.
If EraseBackground gets called for radio/checkbox
- the artifacts are gone
- the background will be white  (as *should* be the page)
- the page will still be grey, until it gets resized - and then it becomes white too.

So if instead the page was fixed, the the artifacts should go to. (probably). And it shouldn't introduce the massive flicker that the checkbox/radio EraseBackground does.





eldonfsr

  • Hero Member
  • *****
  • Posts: 501
Re: TageControl some strange only change de size of form and look efect..
« Reply #9 on: August 14, 2024, 02:54:19 pm »
I see and understand i will take care thanks so much for your help and time....

I gone eliminate show image on pages later i tried on different way....

i using lazarus 3.2 windows 10 64


Great help...


 

dseligo

  • Hero Member
  • *****
  • Posts: 1365
Re: TageControl some strange only change de size of form and look efect..
« Reply #10 on: August 14, 2024, 08:17:42 pm »
It should be reported as a bug, with the latest zip.
The "dat" file isn't needed (the app seems to create it itself).
I created bug report (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41077).

Quote
The problem actually (most likely) is not the artifacts. The page doesn't paint it's background.

I think it's more than just background, see attached (enlarged) screenshot. E.g., you can see text 'Controlled' over text 'Made From' from another checkbox.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10298
  • Debugger - SynEdit - and more
    • wiki
Re: TageControl some strange only change de size of form and look efect..
« Reply #11 on: August 14, 2024, 08:33:21 pm »
I think it's more than just background, see attached (enlarged) screenshot. E.g., you can see text 'Controlled' over text 'Made From' from another checkbox.

That is something that likely could be optimized...

Basically the whole thing is probably painted several times while the component and/or pages are added. Those extra paints aren't needed, but shouldn't cause the problem, as whatever they painted should be replaced (unless the later paints are partial, due to the earlier paints being assumed vaild).

In more detail (my guess)...
- When the page is created it is at some point painted.
- Then layout changes (maybe when more pages are inserted, and a 2nd line of tabs appears, and stuff is shifted)
- Now the old painted-text is still in place, and it isn't cleared.

But that is a guess only.

 

TinyPortal © 2005-2018