added OpenDialog Filters from Salvatore Coppola

git-svn-id: trunk@7003 -
This commit is contained in:
mattias 2005-03-21 09:14:17 +00:00
parent 62ef8130bc
commit e1b84e31df
3 changed files with 14 additions and 5 deletions

View File

@ -134,8 +134,8 @@ begin
Opendlg := TOpenDialog.Create(Self);
Try
Opendlg.Options:=[ofextensiondifferent, ofpathmustexist, offilemustexist, ofenablesizing];
Opendlg.DefaultExt:='.xpm';
Opendlg.Filter:='*.xpm';
Opendlg.Filter:='All supported files (*.xpm;*.bmp)|*.xpm;*.bmp|'+
'Pixmap (*.xpm)|*.xpm|Bitmap (*.bmp)|*.bmp';
OpenDlg.InitialDir:=fDirName; //last rirectory
If OpenDlg.Execute then

View File

@ -360,8 +360,8 @@ end;
constructor TOpenPictureDialog.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FDefaultFilter := Format(rsAllFiles, [GetAllFilesMask, GetAllFilesMask,
GraphicFilter(TGraphic)]);
FDefaultFilter := GraphicFilter(TGraphic)+'|'+Format(rsAllFiles,
[GetAllFilesMask, GetAllFilesMask,'']);
Filter:=FDefaultFilter;
FPictureGroupBox:=TGroupBox.Create(Self);

View File

@ -138,7 +138,6 @@ type
procedure AddFileButtonClick(Sender: TObject);
procedure AddFilePageResize(Sender: TObject);
procedure AddFileShortenButtonClick(Sender: TObject);
procedure AddFilesPageResize(Sender: TObject);
procedure AddToPackageDlgClose(Sender: TObject;
var CloseAction: TCloseAction);
procedure AddUnitButtonClick(Sender: TObject);
@ -155,6 +154,7 @@ type
procedure ClassNameEditChange(Sender: TObject);
procedure ComponentUnitFileBrowseButtonClick(Sender: TObject);
procedure ComponentUnitFileShortenButtonClick(Sender: TObject);
procedure AddFilesPageResize(Sender: TObject);
procedure FilesAddButtonClick(Sender: TObject);
procedure FilesBrowseButtonClick(Sender: TObject);
procedure FilesDeleteButtonClick(Sender: TObject);
@ -546,6 +546,11 @@ begin
LazPackage.GetFileDialogInitialDir(OpenDialog.InitialDir);
OpenDialog.Title:=lisOpenFile;
OpenDialog.Options:=OpenDialog.Options+[ofFileMustExist,ofPathMustExist];
OpenDialog.Filter:='Lazarus File (*.pas;*.pp;*.inc;*.lfm;*.lrs)|*.pas;*.pp;*.inc;*.lfm;*.lrs'
+'|Pascal unit (*.pp;*.pas)|*.pp;*.pas'
+'|Pascal source file (*.pas)|*.pas'
+'|FreePascal source file (*.pp)|*.pp'
+'|All files ('+GetAllFilesMask+')|'+GetAllFilesMask;
if OpenDialog.Execute then begin
AFilename:=CleanAndExpandFilename(OpenDialog.Filename);
if FileExists(AFilename) then begin
@ -615,6 +620,10 @@ begin
LazPackage.GetFileDialogInitialDir(OpenDialog.InitialDir);
OpenDialog.Title:=lisOpenFile;
OpenDialog.Options:=OpenDialog.Options+[ofFileMustExist,ofPathMustExist];
OpenDialog.Filter:='Pascal unit (*.pp;*.pas)|*.pp;*.pas'
+'|Pascal source file (*.pas)|*.pas'
+'|FreePascal source file (*.pp)|*.pp'
+'|All files ('+GetAllFilesMask+')|'+GetAllFilesMask;
if OpenDialog.Execute then begin
AFilename:=CleanAndExpandFilename(OpenDialog.Filename);
if FileExists(AFilename) then begin