localized gtk interface

git-svn-id: trunk@2145 -
This commit is contained in:
mattias 2002-08-17 23:41:01 +00:00
parent a684ea060d
commit 5a859b3806

View File

@ -30,15 +30,6 @@
// {$DEFINE ASSERT_IS_ON} // {$DEFINE ASSERT_IS_ON}
{$EndIf} {$EndIf}
const
SYes = 'Yes';
SNo = 'No';
SOK = 'OK';
SCancel = 'Cancel';
SAbort = 'Abort';
SRetry = 'Retry';
SIgnore = 'Ignore';
const const
BOOL_TEXT: array[Boolean] of string = ('False', 'True'); BOOL_TEXT: array[Boolean] of string = ('False', 'True');
@ -604,9 +595,9 @@ var TargetEntries: PGtkTargetEntry;
procedure AddTargetEntry(var Index: integer; const FormatName: string); procedure AddTargetEntry(var Index: integer; const FormatName: string);
begin begin
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln(' AddTargetEntry ',FormatName); writeln(' AddTargetEntry ',FormatName);
{$EndIf} {$EndIf}
TargetEntries[Index].Target := StrAlloc(Length(FormatName) + 1); TargetEntries[Index].Target := StrAlloc(Length(FormatName) + 1);
StrPCopy(TargetEntries[Index].Target, FormatName); StrPCopy(TargetEntries[Index].Target, FormatName);
TargetEntries[Index].Info:=Index; TargetEntries[Index].Info:=Index;
@ -692,20 +683,21 @@ begin
SetClipboardWidget(OldClipboardWidget); SetClipboardWidget(OldClipboardWidget);
// taking the ownership // taking the ownership
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] C'); writeln('[TgtkObject.ClipboardGetOwnerShip] C');
{$EndIf} {$EndIf}
if gtk_selection_owner_set(ClipboardWidget, ClipboardTypeAtoms[ClipboardType],0)=0 then if gtk_selection_owner_set(ClipboardWidget,
begin ClipboardTypeAtoms[ClipboardType],0)=0
{$IfDef DEBUG_CLIPBOARD} then begin
writeln('[TgtkObject.ClipboardGetOwnerShip] D FAILED'); {$IfDef DEBUG_CLIPBOARD}
{$EndIf} writeln('[TgtkObject.ClipboardGetOwnerShip] D FAILED');
{$EndIf}
exit; exit;
end; end;
{$IfDef DEBUG_CLIPBOARD} {$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] YEAH, got it!'); writeln('[TgtkObject.ClipboardGetOwnerShip] YEAH, got it!');
{$EndIf} {$EndIf}
ClipboardHandler[ClipboardType]:=OnRequestProc; ClipboardHandler[ClipboardType]:=OnRequestProc;
Result:=true; Result:=true;
@ -732,7 +724,7 @@ begin
AtomName:=PChar(AMimeType); AtomName:=PChar(AMimeType);
Result:=gdk_atom_intern(AtomName,0); Result:=gdk_atom_intern(AtomName,0);
end else end else
raise Exception.Create( RaiseException(
'ERROR: TgtkObject.ClipboardRegisterFormat gdk not initialized'); 'ERROR: TgtkObject.ClipboardRegisterFormat gdk not initialized');
end; end;
@ -3543,47 +3535,25 @@ end;
Function TGTKObject.GetCmdLineParamDescForInterface: string; Function TGTKObject.GetCmdLineParamDescForInterface: string;
const const
e = {$IfDef win32}#13+{$EndIf}#10; e = {$IfDef win32}#13+{$EndIf}#10;
function b(const s: string): string;
begin
Result:=BreakString(s,75,22)+e+e;
end;
begin begin
Result:= Result:=
'--gtk-module module Load the specified module at startup.'+e+ b(rsgtkOptionModule)
e+ +b(rsgOptionFatalWarnings)
'--g-fatal-warnings Warnings and errors generated by Gtk+/GDK will'+e+ +b(rsgtkOptionDebug)
' halt the application.'+e+ +b(rsgtkOptionNoDebug)
e+ +b(rsgdkOptionDebug)
'--gtk-debug flags Turn on specific Gtk+ trace/debug messages.'+e+ +b(rsgdkOptionNoDebug)
e+ +b(rsgtkOptionDisplay)
'--gtk-no-debug flags Turn off specific Gtk+ trace/debug messages.'+e+ +b(rsgtkOptionSync)
e+ +b(rsgtkOptionNoXshm)
'--gdk-debug flags Turn on specific GDK trace/debug messages.'+e+ +b(rsgtkOptionName)
e+ +b(rsgtkOptionClass);
'--gdk-no-debug flags Turn off specific GDK trace/debug messages.'+e+
e+
'--display h:s:d Connect to the specified X server, where "h" is'+e+
' the hostname, "s" is the server number (usually'+e+
' 0), and "d" is the display number (typically'+e+
' omitted). If --display is not specified, the'+e+
' DISPLAY environment variable is used.'+e+
e+
'--sync Call XSynchronize (display, True) after the X'+e+
' server connection has been established. This'+e+
' makes debugging X protocol erros easier,'+e+
' because X request buffering will be disabled and'+e+
' X errors will be received immediatey after the'+e+
' protocol request that generated the error has'+e+
' been processed by the X server.'+e+
e+
'--no-xshm Disable use of the X Shared Memory Extension.'+e+
e+
'--name programe Set program name to "progname". If not'+e+
' specified, program name will be set to'+e+
' ParamStr(0).'+e+
e+
'--class classname Following Xt conventions, the class of a'+e+
' program is the program name with the initial'+e+
' character capitalized. For example, the class'+e+
' name for gimp is "Gimp". If --class is'+e+
' specified, the class of the program will be'+e+
' set to "classname".'+e;
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -5125,38 +5095,38 @@ begin
DialogType:= (uType and $0000000F); DialogType:= (uType and $0000000F);
if DialogType = MB_OKCANCEL if DialogType = MB_OKCANCEL
then begin then begin
CreateButton(SOK, IDOK); CreateButton(PChar(rsMbOK), IDOK);
CreateButton(SCancel, IDCANCEL); CreateButton(PChar(rsMbCancel), IDCANCEL);
end end
else begin else begin
if DialogType = MB_ABORTRETRYIGNORE if DialogType = MB_ABORTRETRYIGNORE
then begin then begin
CreateButton(SAbort, IDABORT); CreateButton(PChar(rsMbAbort), IDABORT);
CreateButton(SRetry, IDRETRY); CreateButton(PChar(rsMbRetry), IDRETRY);
CreateButton(SIgnore, IDIGNORE); CreateButton(PChar(rsMbIgnore), IDIGNORE);
end end
else begin else begin
if DialogType = MB_YESNOCANCEL if DialogType = MB_YESNOCANCEL
then begin then begin
CreateButton(SYes, IDYES); CreateButton(PChar(rsMbYes), IDYES);
CreateButton(SNo, IDNO); CreateButton(PChar(rsMbNo), IDNO);
CreateButton(SCancel, IDCANCEL); CreateButton(PChar(rsMbCancel), IDCANCEL);
end end
else begin else begin
if DialogType = MB_YESNO if DialogType = MB_YESNO
then begin then begin
CreateButton(SYes, IDYES); CreateButton(PChar(rsMbYes), IDYES);
CreateButton(SNo, IDNO); CreateButton(PChar(rsMbNo), IDNO);
end end
else begin else begin
if DialogType = MB_RETRYCANCEL if DialogType = MB_RETRYCANCEL
then begin then begin
CreateButton(SRetry, IDRETRY); CreateButton(PChar(rsMbRetry), IDRETRY);
CreateButton(SCancel, IDCANCEL); CreateButton(PChar(rsMbCancel), IDCANCEL);
end end
else begin else begin
{ We have no buttons to show. Create the default of OK button } { We have no buttons to show. Create the default of OK button }
CreateButton(SOK, IDOK); CreateButton(PChar(rsMbOK), IDOK);
end; end;
end; end;
end; end;
@ -7842,6 +7812,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.213 2003/03/09 21:13:32 mattias
localized gtk interface
Revision 1.212 2003/02/28 19:54:05 mattias Revision 1.212 2003/02/28 19:54:05 mattias
added ShowWindow added ShowWindow