View Issue Details

IDProjectCategoryView StatusLast Update
0019131Packages-public2017-11-19 10:22
ReporterAvishai Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version0.9.31 (SVN) 
Summary0019131: RTL Forms do not mirror properly
DescriptionLazarus Forms do not mirror properly when set to bdRightToLeft. The buttons (Close, Maximize and Minimize) Should be on the Left. The Icon and Caption should be on the Right. I have attached an image of MS-Notepad on a Hebrew installation of Window 7 to show this. This would be true for all Right To Left languages.
Tagsbidi, forms, rtl
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Relationships

child of 0019303 acknowledged Lazarus BiDi meta issue 

Activities

2011-04-09 08:57

 

RTL Form.PNG (33,874 bytes)   
RTL Form.PNG (33,874 bytes)   

Avishai

2011-08-21 11:36

reporter   ~0050987

For Windows, this code flips the TForm, but has bad side effects. The Client Area becomes black and can not be changed. There are other side effects as well, but you can "cover up" the side effects by placing a TPanel on the Form and set it to Align:= alClient. You should leave TForm.BiDiMode:= bdLeftToRight so that the TForm.Caption is properly placed and set the TPanel.BiDiMode:= bdRightToLeft. The TPanel then becomes the Parent for all controls placed on it. It works, but this is such a BAD solution :(

procedure MakeFormRightToLeft(Sender: TObject);
{Make Form RightToLeft}
const
  Frm_GETHEADER = $101F;
var
  Header: Thandle;
begin
{$IfDef Windows}
  with Sender as TForm do begin
    Header:= SendMessage(Handle, Frm_GETHEADER, 0, 0);
    SetWindowLong(Handle, GWL_EXSTYLE,
      GetWindowLong(Handle, GWL_EXSTYLE) or
      WS_EX_LAYOUTRTL or WS_EX_NOINHERITLAYOUT);
      invalidate;
  end;
{$EndIf}
end;

Avishai

2011-09-13 13:23

reporter   ~0051774

Last edited: 2013-12-28 16:20

View 4 revisions

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LclType, Forms, Controls, Graphics, Windows;

type

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

var
  Form1: TForm1;

implementation

{$R *.lfm}

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

end.

Zaher Dirkey

2012-05-15 18:58

reporter   ~0059624

I disagree with flip the form button header, this button must stay at other application depend on the system not the application.

Even a Microsoft isn't using it in its application like Office, it is just used as a temporary solution when Windows 98 come.

Avishai

2012-05-16 09:50

reporter   ~0059641

Last edited: 2012-05-16 11:18

"Even a Microsoft isn't using it" This is not true. On a true Hebrew/Arabic... system, MS Forms are flipped as are many other products. Also, Microsoft has a whitepaper about making RightToLeft Forms and Applications explaining what must be done and the different methods. For Win7, To get a true Hebrew/Arabic... system, you must use Windows Ultimate.

Update: See
  http://www.microsoft.com/middleeast/msdn/visualstudio2005.aspx
  http://www.microsoft.com/middleeast/msdn/mirror.aspx

Issue History

Date Modified Username Field Change
2011-04-09 08:57 Avishai New Issue
2011-04-09 08:57 Avishai File Added: RTL Form.PNG
2011-04-09 08:57 Avishai Widgetset => Win32/Win64
2011-04-09 18:29 Zaher Dirkey Tag Attached: bidi
2011-04-13 06:48 Avishai Tag Attached: rtl
2011-04-13 06:49 Avishai Tag Attached: forms
2011-05-06 22:17 Juha Manninen Relationship added related to 0019303
2011-08-21 11:36 Avishai Note Added: 0050987
2011-09-13 13:23 Avishai Note Added: 0051774
2011-09-13 14:00 Avishai Note Edited: 0051774
2011-09-15 11:46 Avishai Note Edited: 0051774
2011-10-07 14:54 Vincent Snijders LazTarget => 1.0
2011-10-07 14:54 Vincent Snijders Status new => acknowledged
2011-10-07 14:54 Vincent Snijders Target Version => 1.0.0
2011-10-07 22:41 Vincent Snijders LazTarget 1.0 => 1.2
2011-10-07 22:41 Vincent Snijders Target Version 1.0.0 =>
2012-05-15 18:58 Zaher Dirkey Note Added: 0059624
2012-05-16 09:50 Avishai Note Added: 0059641
2012-05-16 10:28 Avishai Note Edited: 0059641
2012-05-16 10:33 Avishai Note Edited: 0059641
2012-05-16 11:18 Avishai Note Edited: 0059641
2013-12-28 16:19 Avishai Note Edited: 0051774 View Revisions
2013-12-28 16:20 Avishai Note Edited: 0051774 View Revisions
2013-12-28 16:20 Avishai Note Edited: 0051774 View Revisions
2014-01-14 15:22 Martin Friebe Target Version => 1.2.0
2014-01-20 13:36 Martin Friebe Target Version 1.2.0 => 1.4
2014-01-20 13:37 Martin Friebe LazTarget 1.2 => 1.4
2014-09-10 00:21 Juha Manninen LazTarget 1.4 => -
2014-09-10 00:21 Juha Manninen Target Version 1.4 =>
2017-11-19 10:22 Juha Manninen Relationship replaced child of 0019303