Recent

Author Topic: TStatusBar and OnDrawPanel  (Read 6298 times)

RENaissance

  • Newbie
  • Posts: 1
TStatusBar and OnDrawPanel
« on: February 20, 2010, 07:56:48 pm »
If i develop in Windows (XP 32 bit SP3 English, FPC 2.2.4, Lazarus 0.9.28.2), then OnDrawPanel event is called for TStatusBar. If i develop in Linux (penSUSE 11.2 32 bit, KDE 4.3.5, FPC 2.4.0-21.1 QT-interface, Lazarus 0.9.28-5.3), then OnDrawPanel event is not called for TStatusBar. The OnCreatePanelClass event for TStatusBar is not called too. What is a trouble?

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: TStatusBar and OnDrawPanel
« Reply #1 on: February 22, 2010, 11:25:43 am »
Bug -> http://bugs.freepascal.org/view.php?id=14495

Workaround: Call the draw function directly.
Code: [Select]
sbMain:TStatusBar
function GetPanelBounds:TRect;
{$ifdef Linux}
sbMainDrawPanel(sbMain,sbMain.Panels[0],GetPanelBounds(sbMain.Panels[0]));
{$endif}

Unfortunately, it doesn't work if repaint is required after overlapping by another window for instance. If you find a better solution (except timer driven :o), tell me.
Lazarus 1.7 (SVN) FPC 3.0.0

 

TinyPortal © 2005-2018