Hi,
In compiling a project for Carbon that I've developed on Linux (GTK2 and Qt), and successfully also compiled for Windows, I've discovered that the TStatusBar that works fine in all those other widgetsets doesn't have its contents drawn on Carbon. To create a small project that demonstrates this, create a new application with as per default a single form, to which add a TStatusBar, to which add a single panel with width of 50 and Style of psOwnerDraw, and a single TButton, then add to the "var" section of Unit1 the Integer variable "n", initialised to 0, and then set the following OnDrawPanel event for the TStatusBar and OnClick event for the TButton:
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
begin
Inc(n);
Form1.Text := '[' + IntToStr(n) + '] Entered StatusBar1DrawPanel';
StatusBar.Canvas.Brush.Color := clGreen;
StatusBar.Canvas.FillRect(Rect);
end;
procedure TForm1.Button1Click(Sender: TObject);
var rect: TRect;
begin
rect.Left := 1;
rect.Right := StatusBar1.Panels[0].Width - 2;
rect.Top := 1;
rect.Bottom := StatusBar1.Height - 2;
StatusBar1.Canvas.Brush.Color := clRed;
StatusBar1.Canvas.FillRect(Rect);
end;
When I run this on all widgetsets other than Carbon, the status bar is immediately filled in red and the form's title bar is set to '[<some small integer>] Entered StatusBar1DrawPanel', and clicking on the button fills in the leftmost area of the status bar in green. When I run it on Carbon, though, none of this happens: the form's title remains "Form1", the statusbar appears but it is coloured the default grey, and clicking on the button has no visible effect.
(If I add to the status bar another panel with Style set to psText and with Text set to "Test", it *does* show up as expected, with the expected text visible)
Is this expected/known behaviour and/or a known bug? If not, can anyone else reproduce it? I'm using Lazarus 1.0.4 on OSX; earlier versions for other platforms.
Thanks for your time.