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}
{$EndIf}
const
SYes = 'Yes';
SNo = 'No';
SOK = 'OK';
SCancel = 'Cancel';
SAbort = 'Abort';
SRetry = 'Retry';
SIgnore = 'Ignore';
const
BOOL_TEXT: array[Boolean] of string = ('False', 'True');
@ -604,9 +595,9 @@ var TargetEntries: PGtkTargetEntry;
procedure AddTargetEntry(var Index: integer; const FormatName: string);
begin
{$IfDef DEBUG_CLIPBOARD}
writeln(' AddTargetEntry ',FormatName);
{$EndIf}
{$IfDef DEBUG_CLIPBOARD}
writeln(' AddTargetEntry ',FormatName);
{$EndIf}
TargetEntries[Index].Target := StrAlloc(Length(FormatName) + 1);
StrPCopy(TargetEntries[Index].Target, FormatName);
TargetEntries[Index].Info:=Index;
@ -692,20 +683,21 @@ begin
SetClipboardWidget(OldClipboardWidget);
// taking the ownership
{$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] C');
{$EndIf}
if gtk_selection_owner_set(ClipboardWidget, ClipboardTypeAtoms[ClipboardType],0)=0 then
begin
{$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] D FAILED');
{$EndIf}
{$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] C');
{$EndIf}
if gtk_selection_owner_set(ClipboardWidget,
ClipboardTypeAtoms[ClipboardType],0)=0
then begin
{$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] D FAILED');
{$EndIf}
exit;
end;
{$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] YEAH, got it!');
{$EndIf}
{$IfDef DEBUG_CLIPBOARD}
writeln('[TgtkObject.ClipboardGetOwnerShip] YEAH, got it!');
{$EndIf}
ClipboardHandler[ClipboardType]:=OnRequestProc;
Result:=true;
@ -732,7 +724,7 @@ begin
AtomName:=PChar(AMimeType);
Result:=gdk_atom_intern(AtomName,0);
end else
raise Exception.Create(
RaiseException(
'ERROR: TgtkObject.ClipboardRegisterFormat gdk not initialized');
end;
@ -3543,47 +3535,25 @@ end;
Function TGTKObject.GetCmdLineParamDescForInterface: string;
const
e = {$IfDef win32}#13+{$EndIf}#10;
function b(const s: string): string;
begin
Result:=BreakString(s,75,22)+e+e;
end;
begin
Result:=
'--gtk-module module Load the specified module at startup.'+e+
e+
'--g-fatal-warnings Warnings and errors generated by Gtk+/GDK will'+e+
' halt the application.'+e+
e+
'--gtk-debug flags Turn on specific Gtk+ trace/debug messages.'+e+
e+
'--gtk-no-debug flags Turn off specific Gtk+ trace/debug messages.'+e+
e+
'--gdk-debug flags Turn on specific GDK trace/debug messages.'+e+
e+
'--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;
b(rsgtkOptionModule)
+b(rsgOptionFatalWarnings)
+b(rsgtkOptionDebug)
+b(rsgtkOptionNoDebug)
+b(rsgdkOptionDebug)
+b(rsgdkOptionNoDebug)
+b(rsgtkOptionDisplay)
+b(rsgtkOptionSync)
+b(rsgtkOptionNoXshm)
+b(rsgtkOptionName)
+b(rsgtkOptionClass);
end;
{------------------------------------------------------------------------------
@ -5125,38 +5095,38 @@ begin
DialogType:= (uType and $0000000F);
if DialogType = MB_OKCANCEL
then begin
CreateButton(SOK, IDOK);
CreateButton(SCancel, IDCANCEL);
CreateButton(PChar(rsMbOK), IDOK);
CreateButton(PChar(rsMbCancel), IDCANCEL);
end
else begin
if DialogType = MB_ABORTRETRYIGNORE
then begin
CreateButton(SAbort, IDABORT);
CreateButton(SRetry, IDRETRY);
CreateButton(SIgnore, IDIGNORE);
CreateButton(PChar(rsMbAbort), IDABORT);
CreateButton(PChar(rsMbRetry), IDRETRY);
CreateButton(PChar(rsMbIgnore), IDIGNORE);
end
else begin
if DialogType = MB_YESNOCANCEL
then begin
CreateButton(SYes, IDYES);
CreateButton(SNo, IDNO);
CreateButton(SCancel, IDCANCEL);
CreateButton(PChar(rsMbYes), IDYES);
CreateButton(PChar(rsMbNo), IDNO);
CreateButton(PChar(rsMbCancel), IDCANCEL);
end
else begin
if DialogType = MB_YESNO
then begin
CreateButton(SYes, IDYES);
CreateButton(SNo, IDNO);
CreateButton(PChar(rsMbYes), IDYES);
CreateButton(PChar(rsMbNo), IDNO);
end
else begin
if DialogType = MB_RETRYCANCEL
then begin
CreateButton(SRetry, IDRETRY);
CreateButton(SCancel, IDCANCEL);
CreateButton(PChar(rsMbRetry), IDRETRY);
CreateButton(PChar(rsMbCancel), IDCANCEL);
end
else begin
{ We have no buttons to show. Create the default of OK button }
CreateButton(SOK, IDOK);
CreateButton(PChar(rsMbOK), IDOK);
end;
end;
end;
@ -7842,6 +7812,9 @@ end;
{ =============================================================================
$Log$
Revision 1.213 2003/03/09 21:13:32 mattias
localized gtk interface
Revision 1.212 2003/02/28 19:54:05 mattias
added ShowWindow