Recent

Author Topic: TGraphicControl hides TWinControl in design time  (Read 6358 times)

caleb9

  • Jr. Member
  • **
  • Posts: 51
TGraphicControl hides TWinControl in design time
« on: July 04, 2011, 11:15:40 am »
Hi,
I have the following problem: my custom TGraphicControls hide buttons, panels etc. (seamingly all TWinControl descendants) ONLY in design time on Mac OS X. Here's the source code of the control:
Code: [Select]
unit Background;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs;

type
  TBackground = class(TGraphicControl)
  protected
    procedure Paint; override;
  end;

procedure Register;

implementation

{ TBackground }

procedure TBackground.Paint;
begin
  with Canvas do
  begin
    Brush.Color := clBlack;
    Rectangle(0, 0, Width, Height);
  end;

  inherited Paint;
end;

procedure Register;
begin
  RegisterComponents('Test',[TBackground]);
end;

end.
The problem doesn't occur in run time, when buttons are drawn in front of the TBackground, as I would expect them to. In Linux everything is fine as well - also in design time. I attach three screenshots which depict the situation on a form. I'm using Lazarus 0.9.30.1 although the situation was the same in 0.9.30. Is this a bug and does anyone know any workaround for it? As you can imagine, with more complex controls it's really annoying not to see some of them in design time :].
Thanks in advance.
« Last Edit: July 04, 2011, 11:19:18 am by caleb9 »

Shebuka

  • Sr. Member
  • ****
  • Posts: 427
Re: TGraphicControl hides TWinControl in design time
« Reply #1 on: July 04, 2011, 11:44:52 am »
Try to select your component, right click on it, z-order, move to back (and click on another component to see changes take effect). It helped me with TImage.

caleb9

  • Jr. Member
  • **
  • Posts: 51
Re: TGraphicControl hides TWinControl in design time
« Reply #2 on: July 04, 2011, 11:57:08 am »
Try to select your component, right click on it, z-order, move to back (and click on another component to see changes take effect). It helped me with TImage.

Thanks Shebuka. Unfortunately this doesn't work - tried both moving TGraphicControl to the back, and moving button to the front but it seems to have no effect. Neither on Linux, with the difference that over there the button is in the front.

Edit: Actually I checked and for me it doesn't even work for TImage... :(
« Last Edit: July 04, 2011, 12:00:49 pm by caleb9 »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: TGraphicControl hides TWinControl in design time
« Reply #3 on: July 04, 2011, 08:10:41 pm »
You can report as a bug with a minimal project which reproduces the issue.

There are some things wrong with the designer in LCL-Carbon, but on the good side it works very well at run time =)

caleb9

  • Jr. Member
  • **
  • Posts: 51
Re: TGraphicControl hides TWinControl in design time
« Reply #4 on: July 05, 2011, 08:51:08 am »
You can report as a bug with a minimal project which reproduces the issue.

There are some things wrong with the designer in LCL-Carbon, but on the good side it works very well at run time =)

Done. :]

 

TinyPortal © 2005-2018