localized gtk interface

git-svn-id: trunk@2319 -
This commit is contained in:
mattias 2002-08-17 23:41:15 +00:00
parent bd90789646
commit caaf6bb9c3

View File

@ -36,7 +36,7 @@ uses
glib, gdk, gtk, {$Ifndef NoGdkPixbufLib}gdkpixbuf,{$EndIf} glib, gdk, gtk, {$Ifndef NoGdkPixbufLib}gdkpixbuf,{$EndIf}
{$ENDIF} {$ENDIF}
LMessages, Controls, Forms, VclGlobals, LMessages, Controls, Forms, VclGlobals,
LCLLinux, LCLType, gtkDef, DynHashArray, LazQueue, GraphType, LCLStrConsts, LCLLinux, LCLType, gtkDef, DynHashArray, LazQueue, GraphType,
GraphMath, Graphics, Buttons, Menus, GTKWinApiWindow, StdCtrls, ComCtrls, GraphMath, Graphics, Buttons, Menus, GTKWinApiWindow, StdCtrls, ComCtrls,
CListBox, KeyMap, Calendar, Arrow, Spin, CommCtrl, ExtCtrls, Dialogs, CListBox, KeyMap, Calendar, Arrow, Spin, CommCtrl, ExtCtrls, Dialogs,
FileCtrl, LResources, Math, GTKGlobals; FileCtrl, LResources, Math, GTKGlobals;
@ -424,35 +424,36 @@ var
implementation implementation
procedure Set_RC_Name(Sender : TObject; AWidget: PGtkWidget);
var RCName: string;
AComponent: TComponent;
begin
if (AWidget=nil) or (not (Sender is TComponent)) then exit;
// check if a unique name can be created procedure Set_RC_Name(Sender : TObject; AWidget: PGtkWidget);
AComponent:=TComponent(Sender); var RCName: string;
while (AComponent<>nil) and (AComponent.Name<>'') do begin AComponent: TComponent;
AComponent:=AComponent.Owner; begin
end; if (AWidget=nil) or (not (Sender is TComponent)) then exit;
if (AComponent=nil) or (AComponent=TComponent(Application)) then begin
// create unique name // check if a unique name can be created
AComponent:=TComponent(Sender); AComponent:=TComponent(Sender);
RCName:=AComponent.Name; while (AComponent<>nil) and (AComponent.Name<>'') do begin
while (AComponent<>nil) do begin AComponent:=AComponent.Owner;
AComponent:=TComponent(AComponent.Owner);
if (AComponent<>nil) and (AComponent.Name<>'') then
RCName:=AComponent.Name+'_'+RCName;
end;
gtk_widget_set_name(AWidget,PChar(RCName));
gtk_widget_set_rc_style(AWidget);
end;
if (Sender is TCustomForm)
and ((Application.MainForm=TCustomForm(Sender))
or (Application.MainForm=nil))
then
UpdateSysColorMap(AWidget);
end; end;
if (AComponent=nil) or (AComponent=TComponent(Application)) then begin
// create unique name
AComponent:=TComponent(Sender);
RCName:=AComponent.Name;
while (AComponent<>nil) do begin
AComponent:=TComponent(AComponent.Owner);
if (AComponent<>nil) and (AComponent.Name<>'') then
RCName:=AComponent.Name+'_'+RCName;
end;
gtk_widget_set_name(AWidget,PChar(RCName));
gtk_widget_set_rc_style(AWidget);
end;
if (Sender is TCustomForm)
and ((Application.MainForm=TCustomForm(Sender))
or (Application.MainForm=nil))
then
UpdateSysColorMap(AWidget);
end;
{$I gtkproc.inc} {$I gtkproc.inc}
{$I gtkcallback.inc} {$I gtkcallback.inc}