mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 11:12:34 +02:00
lcl: remove ver2_0 workarounds
git-svn-id: trunk@23392 -
This commit is contained in:
parent
c07babe2e7
commit
216da02c61
@ -1326,9 +1326,7 @@ begin
|
||||
RegisterComponents('Data Controls',[TDBNavigator,TDBText,TDBEdit,TDBMemo,
|
||||
TDBImage,TDBListBox,TDBLookupListBox,TDBComboBox,TDBLookupComboBox,
|
||||
TDBCheckBox, TDBRadioGroup, TDBCalendar,TDBGroupBox]);
|
||||
{$IFNDEF VER2_0}
|
||||
RegFields(DefaultFieldClasses);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
||||
|
@ -30,12 +30,6 @@ email: jesusrmx@yahoo.com.mx
|
||||
|
||||
}
|
||||
|
||||
{$IF defined(VER2_0_2) and defined(win32)}
|
||||
// FPC <= 2.0.2 compatibility code
|
||||
// WINDOWS define was added after FPC 2.0.2
|
||||
{$define WINDOWS}
|
||||
{$endif}
|
||||
|
||||
unit Grids;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
@ -2186,17 +2186,10 @@ function TWin32WidgetSet.GetWindowLong(Handle: HWND; Int: Integer): PtrInt;
|
||||
begin
|
||||
//TODO:Started but not finished
|
||||
Assert(False, Format('Trace:> [TWin32WidgetSet.GETWINDOWLONG] HWND: 0x%x, int: 0x%x (%d)', [Handle, int, int]));
|
||||
{$ifdef ver2_0}
|
||||
if UnicodeEnabledOS then
|
||||
Result := Windows.GetWindowLongW(Handle, int)
|
||||
else
|
||||
Result := Windows.GetWindowLong(Handle, int);
|
||||
{$else}
|
||||
if UnicodeEnabledOS then
|
||||
Result := Windows.GetWindowLongPtrW(Handle, int)
|
||||
else
|
||||
Result := Windows.GetWindowLongPtr(Handle, int);
|
||||
{$endif}
|
||||
Assert(False, Format('Trace:< [TWin32WidgetSet.GETWINDOWLONG] HWND: 0x%x, int: 0x%x (%d) --> 0x%x (%d)', [Handle, int, int, Result, Result]));
|
||||
end;
|
||||
|
||||
@ -3296,17 +3289,10 @@ function TWin32WidgetSet.SetWindowLong(Handle: HWND; Idx: Integer; NewLong: PtrI
|
||||
begin
|
||||
//TODO: Finish this;
|
||||
Assert(False, Format('Trace:> [TWin32WidgetSet.SetWindowLong] HWND: 0x%x, Idx: 0x%x(%d), Value: 0x%x(%d)', [Handle, Idx, Idx, NewLong, NewLong]));
|
||||
{$ifdef ver2_0}
|
||||
if UnicodeEnabledOS then
|
||||
Result := Windows.SetWindowLongW(Handle, Idx, NewLong)
|
||||
else
|
||||
Result := Windows.SetWindowLong(Handle, Idx, NewLong);
|
||||
{$else}
|
||||
if UnicodeEnabledOS then
|
||||
Result := Windows.SetWindowLongPtrW(Handle, Idx, NewLong)
|
||||
else
|
||||
Result := Windows.SetWindowLongPtr(Handle, Idx, NewLong);
|
||||
{$endif}
|
||||
Assert(False, Format('Trace:< [TWin32WidgetSet.SetWindowLong] HWND: 0x%x, Idx: 0x%x(%d), Value: 0x%x(%d) --> 0x%x(%d)', [Handle, Idx, Idx, NewLong, NewLong, Result, Result]));
|
||||
end;
|
||||
|
||||
|
@ -137,7 +137,7 @@ type
|
||||
var CompClassName, CompName: String); override;
|
||||
function BeginProperty: String; override;
|
||||
|
||||
procedure Read(var Buf; Count: LongInt); {$IFNDEF VER2_0}override;{$ENDIF}
|
||||
procedure Read(var Buf; Count: LongInt); override;
|
||||
procedure ReadBinary(const DestData: TMemoryStream); override;
|
||||
function ReadFloat: Extended; override;
|
||||
function ReadSingle: Single; override;
|
||||
@ -250,7 +250,7 @@ type
|
||||
procedure EndProperty; override;
|
||||
function GetStackPath(Root: TComponent): string;
|
||||
|
||||
procedure Write(const Buffer; Count: Longint); {$IFNDEF VER2_0}override;{$ENDIF}
|
||||
procedure Write(const Buffer; Count: Longint); override;
|
||||
procedure WriteBinary(const Buffer; Count: LongInt); override;
|
||||
procedure WriteBoolean(Value: Boolean); override;
|
||||
procedure WriteFloat(const Value: Extended); override;
|
||||
|
@ -334,7 +334,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{$ifndef ver2_0}
|
||||
function Translate (Name,Value : AnsiString; Hash : Longint; arg:pointer) : AnsiString;
|
||||
var
|
||||
po: TPOFile;
|
||||
@ -346,7 +345,6 @@ begin
|
||||
if result<>'' then
|
||||
result:=UTF8ToSystemCharSet(result);
|
||||
end;
|
||||
{$endif ver2_0}
|
||||
|
||||
function TranslateUnitResourceStrings(const ResUnitName, AFilename: string
|
||||
): boolean;
|
||||
@ -365,44 +363,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TranslateUnitResourceStrings(const ResUnitName: string; po: TPOFile
|
||||
): boolean;
|
||||
{$ifdef ver2_0}
|
||||
var
|
||||
TableID, StringID, TableCount: Integer;
|
||||
s: String;
|
||||
DefValue: String;
|
||||
{$endif ver2_0}
|
||||
function TranslateUnitResourceStrings(const ResUnitName: string; po: TPOFile): boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
try
|
||||
{$ifdef ver2_0}
|
||||
for TableID:=0 to ResourceStringTableCount - 1 do begin
|
||||
TableCount := ResourceStringCount(TableID);
|
||||
|
||||
// check if this table belongs to the ResUnitName
|
||||
if TableCount=0 then continue;
|
||||
s:=GetResourceStringName(TableID,0);
|
||||
if CompareText(ResUnitName+'.',LeftStr(s,length(ResUnitName)+1))<>0
|
||||
then continue;
|
||||
|
||||
// translate all resource strings of the unit
|
||||
for StringID := 0 to TableCount - 1 do begin
|
||||
DefValue:=GetResourceStringDefaultValue(TableID,StringID);
|
||||
// get UTF8 string
|
||||
s := po.Translate(GetResourceStringName(TableID,StringID),DefValue);
|
||||
|
||||
if Length(s) > 0 then begin
|
||||
// convert UTF8 to current local
|
||||
s:=UTF8ToSystemCharSet(s);
|
||||
SetResourceStringValue(TableID,StringID,s);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{$else ver2_0}
|
||||
SetUnitResourceStrings(ResUnitName,@Translate,po);
|
||||
{$endif ver2_0}
|
||||
Result:=true;
|
||||
Result:=true;
|
||||
except
|
||||
on e: Exception do begin
|
||||
{$IFNDEF DisableChecks}
|
||||
|
Loading…
Reference in New Issue
Block a user