Recent

Author Topic: Cannot create Clear BCPanel at run time  (Read 1135 times)

Josh

  • Hero Member
  • *****
  • Posts: 1274
Cannot create Clear BCPanel at run time
« on: April 29, 2022, 02:58:44 pm »
Hi

Odd, hopefully i am doing something stupd.

I cannot create a BCPanel (0 Opacity Color clear) at runtime,I can create one at designtime, but runtime it appears as black.

Project attached, click the button to create it.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Cannot create Clear BCPanel at run time
« Reply #1 on: April 29, 2022, 07:35:03 pm »
Hi!

I get the same result like you got.

But with playing  around with the dynamic created  BCPanel I got a trace where the faulty behaviour starts:

The assigning of the parent does not seem to work.

Try after assigning the parent :

Code: Pascal  [Select][+][-]
  1. ShowMessage (parent.name);
  2.  

This code crashes - the parent is still Nil.

Winni



Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: Cannot create Clear BCPanel at run time
« Reply #2 on: April 29, 2022, 08:25:10 pm »
hi winni

its odd,

if you create with nil, then assign parent to form1, you get memory leak on close (so created bcpanel cant be part of the form container).

if you create with Form1 ( and no parent assigning) you get black, no mem leak on closing
if you create with self and assign and assign parent you get black, no mem leak on closing

something is up with this control...?
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

lainz

  • Hero Member
  • *****
  • Posts: 4470
    • https://lainz.github.io/
Re: Cannot create Clear BCPanel at run time
« Reply #3 on: April 29, 2022, 11:10:46 pm »
BCPanel can't be transparent because is a TControl descendant.

Josh

  • Hero Member
  • *****
  • Posts: 1274
Re: Cannot create Clear BCPanel at run time
« Reply #4 on: April 30, 2022, 11:21:00 am »
hi lainz,

ok, so why when created a design time, with the same properties i get clear panel, but at runtime i get a black panel ?

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Cannot create Clear BCPanel at run time
« Reply #5 on: April 30, 2022, 11:58:21 am »
Hello.

Afaik, (semi)transparent panels are not possible with LCL (Delphi does it since Delphi 1).

Fortunately MSEgui does it for each widget!  ;)

https://github.com/mse-org/mseuniverse/tree/main/samples/widgets/semitransparent_panel

Fre;D
« Last Edit: April 30, 2022, 01:21:30 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Cannot create Clear BCPanel at run time
« Reply #6 on: April 30, 2022, 02:40:26 pm »
Hi!


Arghh! I got the "bad boys":

If you set

Code: Pascal  [Select][+][-]
  1. fpanel.Rounding.RoundX:=0;
  2. fpanel.Rounding.RoundY:=0;  
  3.  

this causes the missbehaviour.

If you set both to 1 or some other value except zero then everything works fine!!!

Happy transparency to everybody!

You should write a bug report

Winni

 

TinyPortal © 2005-2018