Sign in Join

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

Mailing lists / lazarus / 2014-12

Strange visibility bug with TCustomGroupBox descendants

6 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Torsten Bonde Christiansen

Hi list.

For some time i have had a strange bug in my program which essentially boils down to a
TRadioGroupBox being visible, even though it has explicit been set to false (in code).

At first i though this was due to some strange coding of mine, but i have managed to
recreate the issue with a short sample (attached).

It seems that all TCustomGroupBox descendants (at least TGroupBox, RadioGroup, CheckGroup)
suffer from the same problem. Even more strange is that in order to provoke the groupbox
to become visible when not wanted, it MUST include a Frame, a PageControl, a Panel and a BitButton.

This bug is only present with the GTK2 widgetset. I have tested with Lazarus 1.2.6 and
latest trunk: Lazarus 1.3 r47043 FPC 2.6.4 x86_64-linux-gtk 2

Can anyone else confirm this bug? And what could be the cause of this?

Kind regards,
Torsten Bonde Christiansen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141201/6f172785/attachment.html> -------------- next part --------------
program project1;

{$mode objfpc}{$H+}

uses

  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  Buttons, StdCtrls, ComCtrls;
{$R *.res}
var
  F: TForm;
  Fr: TFrame;
  P: TPanel;
  CloseBtn: TBitBtn;
  PG: TPageControl;
  TS: TTabSheet;
  GB: TCustomGroupBox;
begin
  RequireDerivedFormResource := True;
  Application.Initialize;
  Application.CreateForm(TForm, F);
  P := TPanel.Create(F);
  P.Align := alBottom;
  P.Height := 48;
  P.Parent := F;
  CloseBtn := TBitBtn.Create(F);
  CloseBtn.Kind := bkClose;
  CloseBtn.Parent := P;
  Fr := TFrame.Create(F);
  PG := TPageControl.Create(Fr);
  PG.Align := alClient;
  PG.Parent := Fr;
  TS := PG.AddTabSheet;
  TS.Caption := 'tab1';
  GB := TRadioGroup.Create(TS);
  GB.Parent := TS;
  GB.Top := 50;
  GB.Visible := false;
  GB := TGroupBox.Create(TS);
  GB.Parent := TS;
  GB.Top := 150;
  GB.Visible := false;
  GB := TCheckGroup.Create(TS);
  GB.Parent := TS;
  GB.Top := 250;
  GB.Visible := false;
  TS := PG.AddTabSheet;
  TS.Caption := 'tab2';
  Fr.Align := alClient;
  Fr.Parent := F;
  Application.Run;
end.

Reply by email

Torsten Bonde Christiansen
to Torsten Bonde Christiansen
Torsten Bonde Christiansen wrote 26 lines
Hi list. For some time i have had a strange bug in my program which essentially boils down to a TRadioGroupBox being visible, even though it has explicit been set to false (in code). At first i though this was due to some strange coding of mine, but i have managed to recreate the issue with a short sample (attached). It seems that all TCustomGroupBox descendants (at least TGroupBox, RadioGroup, CheckGroup) suffer from the same problem. Even more strange is that in order to provoke the groupbox to become visible when not wanted, it MUST include a Frame, a PageControl, a Panel and a BitButton. This bug is only present with the GTK2 widgetset. I have tested with Lazarus 1.2.6 and latest trunk: Lazarus 1.3 r47043 FPC 2.6.4 x86_64-linux-gtk 2 Can anyone else confirm this bug? And what could be the cause of this? Kind regards, Torsten Bonde Christiansen.

I forgot to include a description of the bug... doh!

When making the switch between the two tab-pages the invisible controls somehow
become visible.

See the video in this link (when it is done transcoding): https://videobin.org/+8cd/b68.html

Regards
Torsten.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141201/0a8088bb/attachment.html>

Reply by email

Mattias Gaertner
to Torsten Bonde Christiansen
Show quoted text 11 lines
On 2014-12-01 14:24, Mattias Gaertner wrote: > Just a note: Normally you would enclose the creation code: > > Application.CreateForm(TForm, F); > F.DisableAutoSizing; > ... > F.EnableAutoSizing; > Application.Run; > > Mattias Thank you for noting, but unfortunately it makes no difference.

It was more a general advice to get less flicker and faster form creation. I didn't expect it to affect the bug.

Please create a bug report.

Mattias

Reply by email

Torsten Bonde Christiansen
to Mattias Gaertner
Mattias Gaertner wrote 20 lines
On Mon, 01 Dec 2014 14:28:08 +0100 Torsten Bonde Christiansen wrote: > On 2014-12-01 14:24, Mattias Gaertner wrote: >> Just a note: Normally you would enclose the creation code: >> >> Application.CreateForm(TForm, F); >> F.DisableAutoSizing; >> ... >> F.EnableAutoSizing; >> Application.Run; >> >> Mattias > Thank you for noting, but unfortunately it makes no difference. It was more a general advice to get less flicker and faster form creation. I didn't expect it to affect the bug. Please create a bug report. Mattias

Bug report created:

http://bugs.freepascal.org/view.php?id=27116

-Torsten.

Reply by email