Sign in Join

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

Mailing lists / lazarus / 2019-03

TLabel or TStaticText?

6 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

frans

Hi,

I'm using Lazarus 1.8.4 on Win10. In my application I have a Form with 2 functions. (1) Is to download files from an internet server using ftp, (2) is to store the data from those files in the datacollection. Sometimes I loose my internet connection and in that case I want to show a warning in the the middle of the form and in front of all the other components. For the warning I use a TLabel component for the layout parameter tlCenter. But the label is partly hidden behind another component (TFileListBox) and BringToFront doesn't help. Now I tried a TStaticText component and that works just fine. Except that it has no Layout property and no Paint procedure I could override. Is there a component that gives me all the behaviour I want? Is there a way to bring the TLabel realy in front of all other components? Is there a way to vertical align the text of a TStaticText caption?

Thx for your reactions

mvg Frans van Leeuwen M 06-51695390 --- Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com

Reply by email

John Landmesser
to frans
what about a new form with FormStyle := fsSystemStayOnTop ?!
frans wrote 18 lines
Hi, I'm using Lazarus 1.8.4 on Win10. In my application I have a Form with 2 functions. (1) Is to download files from an internet server using ftp, (2) is to store the data from those files in the datacollection. Sometimes I loose my internet connection and in that case I want to show a warning in the the middle of the form and in front of all the other components. For the warning I use a TLabel component for the layout parameter tlCenter. But the label is partly hidden behind another component (TFileListBox) and BringToFront doesn't help. Now I tried a TStaticText component and that works just fine. Except that it has no Layout property and no Paint procedure I could override. Is there a component that gives me all the behaviour I want? Is there a way to bring the TLabel realy in front of all other components? Is there a way to vertical align the text of a TStaticText caption? Thx for your reactions

Reply by email

frans
to John Landmesser

I thougth of that, but I need the focus on the original form. The mesaage is only informative, all the functionality must be availabe.

mvg
Frans van Leeuwen
M 06-51695390

Op 15-3-2019 om 14:08 schreef John Landmesser via lazarus:

Show quoted text 23 lines
what about a new form with FormStyle := fsSystemStayOnTop ?! Am 15.03.19 um 12:37 schrieb frans via lazarus: > Hi, > > I'm using Lazarus 1.8.4 on Win10. In my application I have a Form > with 2 functions. (1) Is to download files from an internet server > using ftp, (2) is to store the data from those files in the > datacollection. > Sometimes I loose my internet connection and in that case I want to > show a warning in the the middle of the form and in front of all the > other components. For the warning I use a TLabel component for the > layout parameter tlCenter. But the label is partly hidden behind > another component (TFileListBox) and BringToFront doesn't help. > Now I tried a TStaticText component and that works just fine. Except > that it has no Layout property and no Paint procedure I could override. > Is there a component that gives me all the behaviour I want? Is there > a way to bring the TLabel realy in front of all other components? Is > there a way to vertical align the text of a TStaticText caption? > > Thx for your reactions >

---
Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com

Reply by email

Mattias Gaertner
to frans
Show quoted text 28 lines
I thougth of that, but I need the focus on the original form. The mesaage is only informative, all the functionality must be availabe. mvg Frans van Leeuwen M 06-51695390 Op 15-3-2019 om 14:08 schreef John Landmesser via lazarus: > what about a new form with FormStyle := fsSystemStayOnTop ?! > > Am 15.03.19 um 12:37 schrieb frans via lazarus: >> Hi, >> >> I'm using Lazarus 1.8.4 on Win10. In my application I have a Form >> with 2 functions. (1) Is to download files from an internet server >> using ftp, (2) is to store the data from those files in the >> datacollection. >> Sometimes I loose my internet connection and in that case I want >> to show a warning in the the middle of the form and in front of >> all the other components. For the warning I use a TLabel component >> for the layout parameter tlCenter. But the label is partly hidden >> behind another component (TFileListBox) and BringToFront doesn't >> help. Now I tried a TStaticText component and that works just >> fine. Except that it has no Layout property and no Paint procedure >> I could override. Is there a component that gives me all the >> behaviour I want? Is there a way to bring the TLabel realy in >> front of all other components? Is there a way to vertical align >> the text of a TStaticText caption?

You can put the TLabel inside a TPanel.

Mattias

Reply by email

Tony Whyman
to Mattias Gaertner

Using a TPanel as a container is generally good advice for similar problems with all TGraphicControl descendents. I often use a TPanel to contain a TImage for this reason.

Perhaps the point that needs to come across is that TLabel is a TGraphicControl and is drawn by the LCL, while TStaticText is a TWinControl descendent (as is TPanel) and is drawn by the underlying "interface" e.g. GTK2. They thus behave differently e.g. with Z-order.

Mattias Gaertner wrote 34 lines
On Fri, 15 Mar 2019 14:42:52 +0100 frans via lazarus wrote: > I thougth of that, but I need the focus on the original form. The > mesaage is only informative, all the functionality must be availabe. > > mvg > Frans van Leeuwen > M 06-51695390 > > Op 15-3-2019 om 14:08 schreef John Landmesser via lazarus: >> what about a new form with FormStyle := fsSystemStayOnTop ?! >> >> Am 15.03.19 um 12:37 schrieb frans via lazarus: >>> Hi, >>> >>> I'm using Lazarus 1.8.4 on Win10. In my application I have a Form >>> with 2 functions. (1) Is to download files from an internet server >>> using ftp, (2) is to store the data from those files in the >>> datacollection. >>> Sometimes I loose my internet connection and in that case I want >>> to show a warning in the the middle of the form and in front of >>> all the other components. For the warning I use a TLabel component >>> for the layout parameter tlCenter. But the label is partly hidden >>> behind another component (TFileListBox) and BringToFront doesn't >>> help. Now I tried a TStaticText component and that works just >>> fine. Except that it has no Layout property and no Paint procedure >>> I could override. Is there a component that gives me all the >>> behaviour I want? Is there a way to bring the TLabel realy in >>> front of all other components? Is there a way to vertical align >>> the text of a TStaticText caption? You can put the TLabel inside a TPanel. Mattias

Reply by email

frans
to Tony Whyman

Thx all, a TPanel is the solution for my problem.

mvg
Frans van Leeuwen
M 06-51695390

Op 15-3-2019 om 15:14 schreef Tony Whyman via lazarus:

Show quoted text 44 lines
Using a TPanel as a container is generally good advice for similar problems with all TGraphicControl descendents. I often use a TPanel to contain a TImage for this reason. Perhaps the point that needs to come across is that TLabel is a TGraphicControl and is drawn by the LCL, while TStaticText is a TWinControl descendent (as is TPanel) and is drawn by the underlying "interface" e.g. GTK2. They thus behave differently e.g. with Z-order. On 15/03/2019 14:04, Mattias Gaertner via lazarus wrote: > On Fri, 15 Mar 2019 14:42:52 +0100 > frans via lazarus wrote: > >> I thougth of that, but I need the focus on the original form. The >> mesaage is only informative, all the functionality must be availabe. >> >> mvg >> Frans van Leeuwen >> M 06-51695390 >> >> Op 15-3-2019 om 14:08 schreef John Landmesser via lazarus: >>> what about a new form with FormStyle := fsSystemStayOnTop ?! >>> >>> Am 15.03.19 um 12:37 schrieb frans via lazarus: >>>> Hi, >>>> >>>> I'm using Lazarus 1.8.4 on Win10. In my application I have a Form >>>> with 2 functions. (1) Is to download files from an internet server >>>> using ftp, (2) is to store the data from those files in the >>>> datacollection. >>>> Sometimes I loose my internet connection and in that case I want >>>> to show a warning in the the middle of the form and in front of >>>> all the other components. For the warning I use a TLabel component >>>> for the layout parameter tlCenter. But the label is partly hidden >>>> behind another component (TFileListBox) and BringToFront doesn't >>>> help. Now I tried a TStaticText component and that works just >>>> fine. Except that it has no Layout property and no Paint procedure >>>> I could override. Is there a component that gives me all the >>>> behaviour I want? Is there a way to bring the TLabel realy in >>>> front of all other components? Is there a way to vertical align >>>> the text of a TStaticText caption? > You can put the TLabel inside a TPanel. > > Mattias

---
Deze e-mail is gecontroleerd op virussen door AVG. http://www.avg.com

Reply by email