lcl: BidiMode:

- notify forms when Application.BidiMode changed
  - use application bidi mode when form get parent bidi mode change notification
  - fix TControl.CMParentBidiModeChanged

git-svn-id: trunk@22022 -
This commit is contained in:
paul 2009-10-04 13:10:48 +00:00
parent 4f58001501
commit 194d1c80e3
4 changed files with 25 additions and 6 deletions

View File

@ -461,6 +461,7 @@ type
procedure WMShowWindow(var message: TLMShowWindow); message LM_SHOWWINDOW;
procedure WMSize(var message: TLMSize); message LM_Size;
procedure CMBiDiModeChanged(var Message: TLMessage); message CM_BIDIMODECHANGED;
procedure CMParentBiDiModeChanged(var Message: TLMessage); message CM_PARENTBIDIMODECHANGED;
procedure CMAppShowBtnGlyphChanged(var Message: TLMessage); message CM_APPSHOWBTNGLYPHCHANGED;
procedure CMAppShowMenuGlyphChanged(var Message: TLMessage); message CM_APPSHOWMENUGLYPHCHANGED;
procedure CMIconChanged(var Message: TLMessage); message CM_ICONCHANGED;

View File

@ -456,10 +456,13 @@ begin
end;
end;
procedure TApplication.SetBidiMode ( const AValue : TBiDiMode ) ;
procedure TApplication.SetBidiMode(const AValue: TBiDiMode) ;
begin
if AValue <> FBidiMode then
begin
FBidiMode := AValue;
NotifyCustomForms(CM_PARENTBIDIMODECHANGED);
end;
end;
procedure TApplication.SetFlags(const AValue: TApplicationFlags);

View File

@ -4866,8 +4866,8 @@ end;
procedure TControl.SetParentBiDiMode(AValue: Boolean);
begin
if FParentBiDiMode=AValue then exit;
FParentBiDiMode:=AValue;
if FParentBiDiMode = AValue then Exit;
FParentBiDiMode := AValue;
if (FParent <> nil) and not (csReading in ComponentState) then
Perform(CM_PARENTBIDIMODECHANGED, 0, 0);
end;
@ -4892,11 +4892,11 @@ procedure TControl.CMParentBidiModeChanged(var Message: TLMessage);
begin
if csLoading in ComponentState then exit;
if FParentBidiMode then
if ParentBidiMode then
begin
if FParent <> nil then
BidiMode := FParent.BidiMode;
FParentBidiMode := true;
ParentBidiMode := True;
end;
end;
@ -4905,7 +4905,7 @@ end;
------------------------------------------------------------------------------}
function TControl.IsBiDiModeStored: boolean;
begin
Result := not FParentBidiMode;
Result := not ParentBidiMode;
end;

View File

@ -610,6 +610,21 @@ begin
end;
end;
procedure TCustomForm.CMParentBiDiModeChanged(var Message: TLMessage);
begin
if csLoading in ComponentState then
Exit;
if ParentBidiMode then
begin
if Parent <> nil then
BidiMode := Parent.BidiMode
else
BidiMode := Application.BidiMode;
ParentBidiMode := True;
end;
end;
procedure TCustomForm.CMAppShowBtnGlyphChanged(var Message: TLMessage);
begin
NotifyControls(Message.msg);