Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-12

Transparent container

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

JoshyFun

Hello Lazarus-List,

I was looking for a transparent container, something like a TPanel but that do not repaint its background. At a first attempt I intercept the OnPaint event of a TPanel and TScrollBox but both of them even when paint does nothing they paint a "btnFace" background.

I look for something like a TImage but that can hold controls inside. Is there something available or maybe the crossplatform caracteristic do not allow such thing ?

Best regards, JoshyFun
Graeme Geldenhuys
to JoshyFun
JoshyFun wrote
that do not repaint its background. At a first attempt I intercept the OnPaint event of a TPanel and TScrollBox but both of them even when paint does nothing they paint a "btnFace" background.

I think you uncovered a bug their. Alternatively create a TCustomComponent descendant and in the constructor add something like the following:

...
  ControlStyle := ControlStyle + [csAcceptsControls, csCaptureMouse,
    csClickEvents, csNoFocus] - [csOpaque];
...

Also, when you say "transparent", do you mean like what can be done with a TLabel, or do you mean the whole window is truly transparent so that you can see through it and onto the desktop? I don't think LCL supports the latter.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/
JoshyFun
to Graeme Geldenhuys

Hello Lazarus-List,

Tuesday, December 22, 2009, 7:35:02 AM, you wrote:

GG> I think you uncovered a bug their. Alternatively create a TCustomComponent GG> descendant and in the constructor add something like the following: GG> ...
GG> ControlStyle := ControlStyle + [csAcceptsControls, csCaptureMouse, GG> csClickEvents, csNoFocus] - [csOpaque];
GG> ...

Hmmmm... That's a possibility... I should study it, never worked in a new component.

GG> Also, when you say "transparent", do you mean like what can be done with a GG> TLabel, or do you mean the whole window is truly transparent so that you GG> can see through it and onto the desktop? I don't think LCL supports the GG> latter.

More like the TLabel transparency, basically and invisible container at runtime that have the autoarrange and autosize capabilities of a TPanel in order to organize groups of controls that share a common background.

Best regards, JoshyFun
Graeme Geldenhuys
to JoshyFun
JoshyFun wrote
Hmmmm... That's a possibility... I should study it, never worked in a new component.

It should be very easy... read on.

More like the TLabel transparency, basically and invisible container at runtime that have the autoarrange and autosize capabilities of a TPanel in order to organize groups of controls that share a common background.

Then than should be relatively easy to do. Well, so I thought. See the message thread titled: "csOpaque seems to be broken in 0.9.29". I don't seem to have much luck with LCL based applications - everything I want to do or try is broken (no offence meant to LCL developers).

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/