View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0019671LazarusLCLpublic2011-07-03 11:282013-12-30 18:22
Assigned ToBart Broersma 
PlatformOSOS Version
Product Version0.9.31 (SVN)Product Build 
Target Version1.4Fixed in Version 
Summary0019671: TStatusBar does not support BiDiMode
DescriptionTStatusBar does not support BiDiMode. It does not Right-Align the Panels and does not display RightToLeft Text correctly even when the Parent.BiDiMode:= bdRightToLeft.
Fixed in Revision
Attached Fileszip file icon [^] (2,889 bytes) 2013-12-26 01:06

- Relationships
related to 0019303acknowledged BiDi meta issue 

-  Notes
Bart Broersma (developer)
2013-12-25 18:59

On Windows part of the problem is in

procedure UpdateStatusBarPanelWidths(const StatusBar: TStatusBar);
which does
Windows.SendMessage(StatusBar.Handle, SB_SETPARTS, StatusBar.Panels.Count, LPARAM(Rights));

Rights is an array of integers indicating the position, in client coordinates, of the right edge of the corresponding part.
See: [^]
It seems that this API always expects the positions to be in ascending order, in effect meaning that panels will always be Left to Right.
If you supply the positions in descending order only the first panel will be drawn.
Avishai (reporter)
2013-12-25 20:29

On Windows to solve most of the problems with RightToLeft:

uses LclType, Windows;

TForm1 = class(TForm)
  StatusBar1: TStatusBar;
  procedure CreateParams(var Params : TCreateParams); override;

procedure TForm1.CreateParams(var Params : TCreateParams);
  inherited CreateParams(Params);
  Params.ExStyle:= Params.ExStyle or WS_EX_LAYOUTRTL;

But you have to disable Themes because of a Lazarus bug that corrupts TCanvas if Themes are enabled. Delphi doesn't have this bug. For my own use I have disabled Themes in Win32Themes.pas but it can't be done for other users.

function TWin32ThemeServices.UseThemes: Boolean;
  //Result := UxTheme.UseThemes and (GetFileVersion(comctl32) >= ComCtlVersionIE6);
  Result:= False; // Added by Avishai
Bart Broersma (developer)
2013-12-26 01:32

Please try r43594 (without your local "bidi alterations").
Avishai (reporter)
2013-12-26 04:53

Per your instructions I used a "Pure Lazarus" installation to test r43594.

TStatusBar is greatly improved for RightToLeft, but there is no gap between the Text and Panel edge. Also the 'Grab Corner' is still on the Right and drawn LeftToRight.

Even if you manage to get TStatusBar to be perfect using only BiDiMode, it only fixes 1 component and there are many components that still need to be fixed. I keep talking about using the CreateParams approach because I have seen how well it works in Delphi and in MS Visual Studio. It fixes *almost* all components without any addition code changes. In fact, you could strip out a lot of RightToLeft handling code. Plus this is the way that MS designed Windows to handle RightToLeft.

If the developers have decided not to take this approach it is certainly their right to do so. Just let me know if this is the case and I will stop talking about it.
Bart Broersma (developer)
2013-12-26 15:17

> Just let me know if this is the case and I will stop talking about it.

I don't have clue.
Avishai (reporter)
2013-12-26 15:32

Haha! OK thanks.
Bart Broersma (developer)
2013-12-30 18:22

1.2 is way to optimistic for BiDi.

- Issue History
Date Modified Username Field Change
2011-07-03 11:28 Avishai New Issue
2011-07-03 11:28 Avishai Widgetset => Win32/Win64
2011-07-03 11:29 Avishai Tag Attached: bidi
2011-10-06 12:12 Vincent Snijders LazTarget => 1.2
2011-10-06 12:12 Vincent Snijders Status new => acknowledged
2011-10-06 12:12 Vincent Snijders Target Version => 1.2.0
2013-12-25 18:59 Bart Broersma Note Added: 0072044
2013-12-25 19:08 Bart Broersma Status acknowledged => confirmed
2013-12-25 20:29 Avishai Note Added: 0072047
2013-12-26 01:06 Bart Broersma File Added:
2013-12-26 01:32 Bart Broersma Note Added: 0072049
2013-12-26 01:32 Bart Broersma Assigned To => Bart Broersma
2013-12-26 01:32 Bart Broersma Status confirmed => feedback
2013-12-26 04:53 Avishai Note Added: 0072050
2013-12-26 04:53 Avishai Status feedback => assigned
2013-12-26 15:17 Bart Broersma Note Added: 0072053
2013-12-26 15:32 Avishai Note Added: 0072056
2013-12-27 16:02 Bart Broersma Relationship added related to 0019303
2013-12-30 18:22 Bart Broersma LazTarget 1.2 => 1.4
2013-12-30 18:22 Bart Broersma Note Added: 0072115
2013-12-30 18:22 Bart Broersma Target Version 1.2.0 => 1.4

MantisBT 1.2.12[^]
Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker