LCL: setBidiMode in CreateWnd, so all ws are correctly updated.fixes #16818

git-svn-id: trunk@26365 -
This commit is contained in:
zeljko 2010-06-30 20:26:10 +00:00
parent fe2b7dfcaf
commit 985aea5d22
3 changed files with 8 additions and 14 deletions

View File

@ -7135,6 +7135,9 @@ begin
if not HandleAllocated then
RaiseGDBException('Handle creation failed creating '+DbgSName(Self));
//debugln('TWinControl.CreateWnd update constraints ... ',DbgSName(Self));
TWSWinControlClass(WidgetSetClass).SetBiDiMode(Self,
UseRightToLeftAlignment, UseRightToLeftReading, UseRightToLeftScrollBar);
Constraints.UpdateInterfaceConstraints;
InvalidateClientRectCache(False);
TWSWinControlClass(WidgetSetClass).ConstraintsChange(Self);

View File

@ -242,19 +242,11 @@ class procedure TGtk2WSWinControl.SetBiDiMode(const AWinControl : TWinControl;
const
WidgetDirection : array[boolean] of longint = (GTK_TEXT_DIR_LTR, GTK_TEXT_DIR_RTL);
begin
gtk_widget_set_direction(PGtkWidget(AWinControl.Handle), WidgetDirection[UseRightToLeftAlign]);
if not WSCheckHandleAllocated(AWinControl, 'SetBiDiMode') then
Exit;
if UseRightToLeftReading then // By default GTK2 support bidi regardless of the layout
begin
end
else begin
end;
if UseRightToLeftScrollBar then // I don't know how to do it for now (if possible)
begin
end
else begin
end;
gtk_widget_set_direction(PGtkWidget(AWinControl.Handle),
WidgetDirection[UseRightToLeftAlign]);
end;

View File

@ -1611,8 +1611,7 @@ begin
ChildOfComplexWidget := ccwNone;
// creates the widget
Widget := CreateWidget(FParams);
if LCLObject.BiDiMode = bdRightToLeft then
setLayoutDirection(QtRightToLeft);
// retrieve default cursor on create
FDefaultCursor := QCursor_create();
QWidget_cursor(Widget, FDefaultCursor);