begin
if opendialog1.Execute then
 begin
  totanum:=totanum+opendialog1.Files.Count;
  rnlist1.RowCount:=totanum;
//  tmptstr:=tstrings.Create ;
  tmptstr:=opendialog1.Files;
  tmplen:=tmptstr.Count ;
  for ii:=0 to tmplen-1 do begin
   rnlist1.Cols[0].Append(ExtractFileName(tmptstr.Strings[ii]));
   rnlist1.Cols[1].Append(ExtractFileName(tmptstr.Strings[ii]));
   rnlist1.Cols[2].Append(ExtractFilePath(tmptstr.Strings[ii]));
  end;
//  rnlist1.Cols[0].AddStrings(tmptstr);
 end;
end;
procedure TBM_CHANGEFILEF.SpeedButton2Click(Sender: TObject);
var nn,cc:integer;
begin
 cc:=rnlist1.Selection.Bottom-rnlist1.Selection.Top+1;
 if rnlist1.RowCount<=2 then rnlist1.rows[1].clear
 else begin
  for nn:= rnlist1.Selection.Top to rnlist1.Selection.Bottom do
   rnlist1.Rows[nn].Clear ;
  for nn:= rnlist1.Selection.Bottom+1 to rnlist1.RowCount-1 do begin
   rnlist1.Rows[nn-cc]:=rnlist1.Rows[nn];
   rnlist1.Rows[nn].Clear ;
  end;
  if rnlist1.RowCount-cc<2 then rnlist1.RowCount:=2
  else  rnlist1.RowCount:= rnlist1.RowCount-cc;
 end;
 totanum:=rnlist1.RowCount-1;
end;
procedure TBM_CHANGEFILEF.SpeedButton3Click(Sender: TObject);
var moban,okstr,nostr,tmpstr :string;
    nn,ii:integer;
    tmplist:tstrings;
begin   //预览
//先执行模板改名
 nostr:='\/:"<>*?|';
 if checkbox1.Checked then begin        //如果允许使用模板
  moban:=combobox2.Text;
   for nn:=1 to rnlist1.RowCount-1 do begin
    okstr:='';
    okstr:=getok(moban,rnlist1.Cells[0,nn],ledit1.Text,radiob1.Checked,nn,true);
    if rnlist1.Cells[0,nn]<>'' then
     if checkbox2.Checked then   //如果允许改扩展名
      rnlist1.Cells[1,nn]:=okstr+getok(combobox3.Text,extractfileext(rnlist1.Cells[0,nn]),ledit1.Text,radiob1.Checked,nn,false)
     else
      rnlist1.Cells[1,nn]:=okstr+extractfileext(rnlist1.Cells[0,nn]);
    tmpstr:='';
    for ii:=1 to length(rnlist1.Cells[1,nn]) do
     if pos(rnlist1.Cells[1,nn][ii],nostr)<=0 then
      tmpstr:=tmpstr+rnlist1.Cells[1,nn][ii];
    rnlist1.Cells[1,nn]:=tmpstr;  
<< 上一页 [21] [22] [23] [24] [25] [26] 下一页