mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 16:20:35 +02:00
LCL, avoid storing default (translated) title for dialogs
git-svn-id: trunk@13303 -
This commit is contained in:
parent
003c9a735e
commit
c247e2ee08
@ -74,8 +74,10 @@ type
|
|||||||
procedure SetHandle(const AValue: THandle);
|
procedure SetHandle(const AValue: THandle);
|
||||||
procedure SetHeight(const AValue: integer);
|
procedure SetHeight(const AValue: integer);
|
||||||
procedure SetWidth(const AValue: integer);
|
procedure SetWidth(const AValue: integer);
|
||||||
|
function IsTitleStored: boolean;
|
||||||
protected
|
protected
|
||||||
function DoExecute : boolean; virtual;
|
function DoExecute : boolean; virtual;
|
||||||
|
function DefaultTitle: string; virtual;
|
||||||
public
|
public
|
||||||
FCompStyle : LongInt;
|
FCompStyle : LongInt;
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
@ -94,7 +96,7 @@ type
|
|||||||
property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
|
property HelpContext: THelpContext read FHelpContext write FHelpContext default 0;
|
||||||
property Width: integer read FWidth write SetWidth;
|
property Width: integer read FWidth write SetWidth;
|
||||||
property Height: integer read FHeight write SetHeight;
|
property Height: integer read FHeight write SetHeight;
|
||||||
property Title: string read FTitle write FTitle;
|
property Title: string read FTitle write FTitle stored IsTitleStored;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -189,6 +191,7 @@ type
|
|||||||
function CheckFileMustExist(const AFileName: string): boolean; virtual;
|
function CheckFileMustExist(const AFileName: string): boolean; virtual;
|
||||||
function CheckAllFiles: boolean; virtual;
|
function CheckAllFiles: boolean; virtual;
|
||||||
function DoExecute: boolean; override;
|
function DoExecute: boolean; override;
|
||||||
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
procedure DoFolderChange; virtual;
|
procedure DoFolderChange; virtual;
|
||||||
@ -204,6 +207,8 @@ type
|
|||||||
{ TSaveDialog }
|
{ TSaveDialog }
|
||||||
|
|
||||||
TSaveDialog = class(TOpenDialog)
|
TSaveDialog = class(TOpenDialog)
|
||||||
|
protected
|
||||||
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
end;
|
end;
|
||||||
@ -214,6 +219,7 @@ type
|
|||||||
TSelectDirectoryDialog = class(TOpenDialog)
|
TSelectDirectoryDialog = class(TOpenDialog)
|
||||||
protected
|
protected
|
||||||
function CheckFileMustExist(const AFilename: string): boolean; override;
|
function CheckFileMustExist(const AFilename: string): boolean; override;
|
||||||
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
end;
|
end;
|
||||||
@ -224,6 +230,8 @@ type
|
|||||||
TColorDialog = class(TCommonDialog)
|
TColorDialog = class(TCommonDialog)
|
||||||
private
|
private
|
||||||
FColor: TColor;
|
FColor: TColor;
|
||||||
|
protected
|
||||||
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
published
|
published
|
||||||
@ -317,6 +325,8 @@ type
|
|||||||
FOptions: TFontDialogOptions;
|
FOptions: TFontDialogOptions;
|
||||||
FPreviewText: string;
|
FPreviewText: string;
|
||||||
procedure SetFont(const AValue: TFont);
|
procedure SetFont(const AValue: TFont);
|
||||||
|
protected
|
||||||
|
function DefaultTitle: string; override;
|
||||||
public
|
public
|
||||||
procedure ApplyClicked; virtual;
|
procedure ApplyClicked; virtual;
|
||||||
constructor Create (AOwner : TComponent); override;
|
constructor Create (AOwner : TComponent); override;
|
||||||
|
@ -27,5 +27,11 @@ constructor TColorDialog.Create(TheOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
fCompStyle := csColorDialog;
|
fCompStyle := csColorDialog;
|
||||||
FTitle:= rsSelectcolorTitle;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TColorDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
Result:=rsSelectcolorTitle;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
constructor TCommonDialog.Create (TheOwner: TComponent);
|
constructor TCommonDialog.Create (TheOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
|
FTitle := DefaultTitle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCommonDialog.Execute: boolean;
|
function TCommonDialog.Execute: boolean;
|
||||||
@ -71,6 +72,11 @@ begin
|
|||||||
FHandle:=AValue;
|
FHandle:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCommonDialog.IsTitleStored: boolean;
|
||||||
|
begin
|
||||||
|
result := FTitle<>DefaultTitle;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCommonDialog.SetHeight(const AValue: integer);
|
procedure TCommonDialog.SetHeight(const AValue: integer);
|
||||||
begin
|
begin
|
||||||
if FHeight=AValue then exit;
|
if FHeight=AValue then exit;
|
||||||
@ -110,3 +116,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
Result := (FUserChoice = mrOk);
|
Result := (FUserChoice = mrOk);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCommonDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
result := '';
|
||||||
|
end;
|
||||||
|
@ -250,6 +250,11 @@ begin
|
|||||||
Result:=CheckAllFiles;
|
Result:=CheckAllFiles;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TOpenDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
Result:= rsfdOpenFile;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TOpenDialog.Create
|
Method: TOpenDialog.Create
|
||||||
Params: AOwner: the owner of the class
|
Params: AOwner: the owner of the class
|
||||||
@ -261,7 +266,6 @@ constructor TOpenDialog.Create(TheOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
fCompStyle:=csOpenFileDialog;
|
fCompStyle:=csOpenFileDialog;
|
||||||
FTitle:= rsfdOpenFile;
|
|
||||||
FOptions := DefaultOpenDialogOptions;
|
FOptions := DefaultOpenDialogOptions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -280,6 +284,11 @@ begin
|
|||||||
if Assigned(OnSelectionChange) then OnSelectionChange(Self);
|
if Assigned(OnSelectionChange) then OnSelectionChange(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSaveDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
Result:=rsfdFileSaveAs;
|
||||||
|
end;
|
||||||
|
|
||||||
{******************************************************************************
|
{******************************************************************************
|
||||||
TSaveDialog
|
TSaveDialog
|
||||||
******************************************************************************}
|
******************************************************************************}
|
||||||
@ -294,7 +303,6 @@ constructor TSaveDialog.Create (AOwner : TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
fCompStyle:=csSaveFileDialog;
|
fCompStyle:=csSaveFileDialog;
|
||||||
FTitle:= rsfdFileSaveAs;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{******************************************************************************
|
{******************************************************************************
|
||||||
@ -307,7 +315,6 @@ constructor TSelectDirectoryDialog.Create(AOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
fCompStyle:=csSelectDirectoryDialog;
|
fCompStyle:=csSelectDirectoryDialog;
|
||||||
FTitle:=rsfdSelectDirectory;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSelectDirectoryDialog.CheckFileMustExist(const AFilename: string): boolean;
|
function TSelectDirectoryDialog.CheckFileMustExist(const AFilename: string): boolean;
|
||||||
@ -321,4 +328,9 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSelectDirectoryDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
Result:=rsfdSelectDirectory;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ constructor TFontDialog.Create (AOwner : TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
fCompStyle := csFontDialog;
|
fCompStyle := csFontDialog;
|
||||||
FTitle:= rsSelectFontTitle;
|
|
||||||
FFont := TFont.Create;
|
FFont := TFont.Create;
|
||||||
FOptions := [fdEffects];
|
FOptions := [fdEffects];
|
||||||
end;
|
end;
|
||||||
@ -56,3 +55,8 @@ begin
|
|||||||
FFont.Assign(AValue);
|
FFont.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFontDialog.DefaultTitle: string;
|
||||||
|
begin
|
||||||
|
Result:=rsSelectFontTitle;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user