mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 23:00:15 +02:00
LCL: fix some inconsistencies in translating dialog titles (patch from cobines, bug #19869):
a) TSavePictureDialog - override DefaultTitle - do not set Title in Create (already done in inherited constructor) - set fCompStyle:=csSaveFileDialog (as in TSaveDialog) b) TCalculatorDialog - don't use your own Title, but use inherited Title property - override DefaultTitle c) TCalendarDialog - don't use your own DialogTitle, but use inherited Title property - remove DialogTitle property - override DefaultTitle git-svn-id: trunk@31848 -
This commit is contained in:
parent
e705d42b04
commit
3677e97597
@ -101,6 +101,7 @@ type
|
|||||||
TSavePictureDialog = class(TOpenPictureDialog)
|
TSavePictureDialog = class(TOpenPictureDialog)
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
end;
|
end;
|
||||||
@ -133,13 +134,11 @@ type
|
|||||||
FOnCalcKey: TKeyPressEvent;
|
FOnCalcKey: TKeyPressEvent;
|
||||||
FOnDisplayChange: TNotifyEvent;
|
FOnDisplayChange: TNotifyEvent;
|
||||||
function GetDisplay: Double;
|
function GetDisplay: Double;
|
||||||
function GetTitle: string;
|
|
||||||
procedure SetTitle(const AValue: string);
|
|
||||||
function TitleStored: Boolean;
|
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
procedure Change; virtual;
|
procedure Change; virtual;
|
||||||
procedure CalcKey(var Key: char); virtual;
|
procedure CalcKey(var Key: char); virtual;
|
||||||
|
function DefaultTitle: string; override;
|
||||||
procedure DisplayChange; virtual;
|
procedure DisplayChange; virtual;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -152,7 +151,7 @@ type
|
|||||||
property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
|
property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
|
||||||
property CalculatorLayout : TCalculatorLayout Read FLayout Write Flayout;
|
property CalculatorLayout : TCalculatorLayout Read FLayout Write Flayout;
|
||||||
property Precision: Byte read FPrecision write FPrecision default DefCalcPrecision;
|
property Precision: Byte read FPrecision write FPrecision default DefCalcPrecision;
|
||||||
property Title: string read GetTitle write SetTitle stored TitleStored;
|
property Title;
|
||||||
property Value: Double read FValue write FValue;
|
property Value: Double read FValue write FValue;
|
||||||
property OnCalcKey: TKeyPressEvent read FOnCalcKey write FOnCalcKey;
|
property OnCalcKey: TKeyPressEvent read FOnCalcKey write FOnCalcKey;
|
||||||
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||||
@ -208,15 +207,14 @@ Type
|
|||||||
FHelpContext: THelpContext;
|
FHelpContext: THelpContext;
|
||||||
FMonthChanged: TNotifyEvent;
|
FMonthChanged: TNotifyEvent;
|
||||||
FYearChanged: TNotifyEvent;
|
FYearChanged: TNotifyEvent;
|
||||||
FDialogTitle:TCaption;
|
|
||||||
FOKCaption:TCaption;
|
FOKCaption:TCaption;
|
||||||
FCancelCaption:TCaption;
|
FCancelCaption:TCaption;
|
||||||
FCalendar:TCalendar;
|
FCalendar:TCalendar;
|
||||||
function IsTitleStored: Boolean;
|
|
||||||
protected
|
protected
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
procedure GetNewDate(Sender:TObject);//or onClick
|
procedure GetNewDate(Sender:TObject);//or onClick
|
||||||
procedure CalendarDblClick(Sender: TObject);
|
procedure CalendarDblClick(Sender: TObject);
|
||||||
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
function Execute: Boolean; override;
|
function Execute: Boolean; override;
|
||||||
@ -228,7 +226,6 @@ Type
|
|||||||
property OnMonthChanged: TNotifyEvent read FMonthChanged write FMonthChanged;
|
property OnMonthChanged: TNotifyEvent read FMonthChanged write FMonthChanged;
|
||||||
property OnYearChanged: TNotifyEvent read FYearChanged write FYearChanged;
|
property OnYearChanged: TNotifyEvent read FYearChanged write FYearChanged;
|
||||||
property DialogPosition: TPosition read FDialogPosition write FDialogPosition default poMainFormCenter;
|
property DialogPosition: TPosition read FDialogPosition write FDialogPosition default poMainFormCenter;
|
||||||
property DialogTitle:TCaption read FDialogTitle write FDialogTitle stored IsTitleStored;
|
|
||||||
property OKCaption:TCaption read FOKCaption write FOKCaption;
|
property OKCaption:TCaption read FOKCaption write FOKCaption;
|
||||||
property CancelCaption:TCaption read FCancelCaption write FCancelCaption;
|
property CancelCaption:TCaption read FCancelCaption write FCancelCaption;
|
||||||
end;
|
end;
|
||||||
@ -436,10 +433,15 @@ begin
|
|||||||
RegisterSavePictureDialog;
|
RegisterSavePictureDialog;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSavePictureDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
Result := rsfdFileSaveAs;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TSavePictureDialog.Create(TheOwner: TComponent);
|
constructor TSavePictureDialog.Create(TheOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
Title:=rsfdFileSaveAs;
|
fCompStyle:=csSaveFileDialog;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -1005,7 +1007,6 @@ end;
|
|||||||
constructor TCalculatorDialog.Create(AOwner: TComponent);
|
constructor TCalculatorDialog.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FTitle:=rsCalculator;
|
|
||||||
FPrecision:=DefCalcPrecision;
|
FPrecision:=DefCalcPrecision;
|
||||||
FBeepOnError:=True;
|
FBeepOnError:=True;
|
||||||
end;
|
end;
|
||||||
@ -1017,21 +1018,6 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCalculatorDialog.GetTitle: string;
|
|
||||||
begin
|
|
||||||
Result:=FTitle;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCalculatorDialog.SetTitle(const AValue: string);
|
|
||||||
begin
|
|
||||||
FTitle:=AValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TCalculatorDialog.TitleStored: Boolean;
|
|
||||||
begin
|
|
||||||
Result:=Title <> rsCalculator;
|
|
||||||
end;
|
|
||||||
|
|
||||||
class procedure TCalculatorDialog.WSRegisterClass;
|
class procedure TCalculatorDialog.WSRegisterClass;
|
||||||
begin
|
begin
|
||||||
inherited WSRegisterClass;
|
inherited WSRegisterClass;
|
||||||
@ -1050,6 +1036,11 @@ begin
|
|||||||
if Assigned(FOnCalcKey) then FOnCalcKey(Self, Key);
|
if Assigned(FOnCalcKey) then FOnCalcKey(Self, Key);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCalculatorDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
Result := rsCalculator;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCalculatorDialog.DisplayChange;
|
procedure TCalculatorDialog.DisplayChange;
|
||||||
begin
|
begin
|
||||||
if Assigned(FOnDisplayChange) then FOnDisplayChange(Self);
|
if Assigned(FOnDisplayChange) then FOnDisplayChange(Self);
|
||||||
@ -1235,7 +1226,6 @@ begin
|
|||||||
DisplaySettings := DefaultDisplaySettings;
|
DisplaySettings := DefaultDisplaySettings;
|
||||||
Date := trunc(Now);
|
Date := trunc(Now);
|
||||||
DialogPosition := poMainFormCenter;
|
DialogPosition := poMainFormCenter;
|
||||||
DialogTitle := rsPickDate;
|
|
||||||
OKCaption := rsMbOK;
|
OKCaption := rsMbOK;
|
||||||
CancelCaption := rsMbCancel;
|
CancelCaption := rsMbCancel;
|
||||||
end;
|
end;
|
||||||
@ -1260,9 +1250,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCalendarDialog.IsTitleStored: Boolean;
|
function TCalendarDialog.DefaultTitle: string;
|
||||||
begin
|
begin
|
||||||
Result:=DialogTitle<>rsPickDate;//controllare
|
Result := rsPickDate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TCalendarDialog.WSRegisterClass;
|
class procedure TCalendarDialog.WSRegisterClass;
|
||||||
@ -1280,7 +1270,7 @@ begin
|
|||||||
DF:=TForm(TForm.NewInstance);
|
DF:=TForm(TForm.NewInstance);
|
||||||
DF.DisableAlign;
|
DF.DisableAlign;
|
||||||
DF.Create(Self.Owner); // Self.Owner, so that poOwnerFormCenter works
|
DF.Create(Self.Owner); // Self.Owner, so that poOwnerFormCenter works
|
||||||
DF.Caption:=DialogTitle;
|
DF.Caption:=Title;
|
||||||
DF.Position:=DialogPosition;
|
DF.Position:=DialogPosition;
|
||||||
DF.BorderStyle:=bsDialog;
|
DF.BorderStyle:=bsDialog;
|
||||||
DF.AutoScroll:=false;
|
DF.AutoScroll:=false;
|
||||||
|
Loading…
Reference in New Issue
Block a user