- TFileDialog.FilterIndex returned value starts from 0 under gtk1 and gtk2 (patch from Valdas Janknas report 0008788)

git-svn-id: trunk@11168 -
This commit is contained in:
paul 2007-05-20 06:47:28 +00:00
parent 1c8450192c
commit b2a7ad27e4
3 changed files with 3 additions and 2 deletions

View File

@ -27,6 +27,7 @@ begin
fCompStyle := csFileDialog; fCompStyle := csFileDialog;
FFiles := TStringList.Create; FFiles := TStringList.Create;
FHistoryList:=TStringList.Create; FHistoryList:=TStringList.Create;
FFilterIndex := 1;
end; end;
{------------------------------------------------------------------------------} {------------------------------------------------------------------------------}

View File

@ -2201,7 +2201,7 @@ var
begin begin
PopulateFileAndDirectoryLists(PGtkFileSelection(theDialog.Handle), PopulateFileAndDirectoryLists(PGtkFileSelection(theDialog.Handle),
AFilterEntry^.Mask); AFilterEntry^.Mask);
TFileDialog(TheDialog).IntfFileTypeChanged(AFilterEntry^.FilterIndex); TFileDialog(TheDialog).IntfFileTypeChanged(AFilterEntry^.FilterIndex + 1);
UpdateDetailView(TOpenDialog(theDialog)); UpdateDetailView(TOpenDialog(theDialog));
end; end;
end; end;

View File

@ -141,7 +141,7 @@ begin
GtkFilter := gtk_file_chooser_get_filter(dialog); GtkFilter := gtk_file_chooser_get_filter(dialog);
GtkFilterList := gtk_file_chooser_list_filters(dialog); GtkFilterList := gtk_file_chooser_list_filters(dialog);
NewFilterIndex := g_slist_index(GtkFilterList, GtkFilter); NewFilterIndex := g_slist_index(GtkFilterList, GtkFilter);
theDialog.IntfFileTypeChanged(NewFilterIndex); theDialog.IntfFileTypeChanged(NewFilterIndex + 1);
g_slist_free(GtkFilterList); g_slist_free(GtkFilterList);
end; end;
end; end;