Gtk2: fixed LTOR & RTOL for complex widgets (listviews etc). fixes #16865

git-svn-id: trunk@26505 -
This commit is contained in:
zeljko 2010-07-07 14:02:49 +00:00
parent 690be5c15b
commit d2fd11cca9

View File

@ -242,15 +242,25 @@ class procedure TGtk2WSWinControl.SetBiDiMode(const AWinControl : TWinControl;
);
const
WidgetDirection : array[boolean] of longint = (GTK_TEXT_DIR_LTR, GTK_TEXT_DIR_RTL);
var
Info: PWidgetInfo;
begin
if not WSCheckHandleAllocated(AWinControl, 'SetBiDiMode') then
Exit;
gtk_widget_set_direction(PGtkWidget(AWinControl.Handle),
WidgetDirection[UseRightToLeftAlign]);
Info := GetWidgetInfo(PGtkWidget(AWinControl.Handle));
if Info <> nil then
begin
if Info^.CoreWidget <> nil then
gtk_widget_set_direction(Info^.CoreWidget,
WidgetDirection[UseRightToLeftAlign]);
if Info^.ClientWidget <> nil then
gtk_widget_set_direction(Info^.ClientWidget,
WidgetDirection[UseRightToLeftAlign]);
end;
end;
function Gtk1GetText(const AWinControl: TWinControl; var AText: String): Boolean;
var
CS: PChar;