function renamefenster(filename,filepath,mode)
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      

ppfig=findobj('tag','ppfig');
ppunits=get(ppfig,'units');
set(ppfig,'units','normalized');
pppos=get(findobj('tag','ppfig'),'position');
set(ppfig,'units',ppunits);



% 
% %figure
% %---------------
% figure1=figure('units','normalized','position',[pppos(1)     pppos(2)+pppos(4)     0.24664     0.17057],...
% 'color',[0.4        0.55         0.7],'Name','file rename options:','Numbertitle','off','Resize','off','Menubar','none','units','normalized');
% 
% %text8
% %----------------
% text8= uicontrol('units','inches','style','text',...
% 'position',[1.3125      1.0833     0.73958     0.23958],...
% 'backgroundcolor',[0.4        0.55         0.7],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','text8',...
% 'String','Find files by:',...
% 'HorizontalAlignment','left');
% 
% %replaceedit
% %----------------
% replaceedit= uicontrol('units','inches','style','edit',...
% 'position',[2.1146     0.52083      1.0208     0.23958],...
% 'backgroundcolor',[1  1  1],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','replaceedit',...
% 'HorizontalAlignment','center');
% 
% %findstringedit
% %----------------
% findstringedit= uicontrol('units','inches','style','edit',...
% 'position',[2.1146     0.80208      1.0208     0.23958],...
% 'backgroundcolor',[1  1  1],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','findstringedit',...
% 'HorizontalAlignment','center');
% 
% %findedit
% %----------------
% findedit= uicontrol('units','inches','style','edit',...
% 'position',[2.1146      1.0833      1.0208     0.23958],...
% 'backgroundcolor',[1  1  1],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','findedit',...
% 'HorizontalAlignment','center');
% 
% %logicpopup
% %----------------
% logicpopup= uicontrol('units','inches','style','popupmenu',...
% 'position',[1.6771      1.4271      1.4688     0.22917],...
% 'backgroundcolor',[1  1  1],...
% 'foregroundcolor',[0  0  0],...
% 'Value',1,...
% 'tag','logicpopup',...
% 'String',{'contains','does not contain','is equal','is unequal'},...
% 'HorizontalAlignment','left');
% 
% %findtypepopup
% %----------------
% findtypepopup= uicontrol('units','inches','style','popupmenu',...
% 'position',[0.13542      1.4271      1.4271     0.21875],...
% 'backgroundcolor',[1  1  1],...
% 'foregroundcolor',[0  0  0],...
% 'Value',1,...
% 'tag','findtypepopup',...
% 'String',{'filepath','filename','extension','version'},...
% 'HorizontalAlignment','center');
% 
% %inclsubdirradio
% %----------------
% inclsubdirradio= uicontrol('units','inches','style','radiobutton',...
% 'position',[0.13542      1.0729       1.125        0.25],...
% 'backgroundcolor',[0.4        0.55         0.7],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','inclsubdirradio',...
% 'String','include subdir',...
% 'HorizontalAlignment','center');
% 
% %cancelbutton
% %----------------
% cancelbutton= uicontrol('units','inches','style','pushbutton',...
% 'position',[0.14583       0.125      1.8438     0.29167],...
% 'backgroundcolor',[0.83137     0.81569     0.78431],...
% 'foregroundcolor',[0  0  0],...
% 'Callback','close',...
% 'Value',0,...
% 'tag','cancelbutton',...
% 'String','Cancel',...
% 'HorizontalAlignment','center');
% 
% %copyreplaceradio
% %----------------
% copyreplaceradio= uicontrol('units','inches','style','radiobutton',...
% 'position',[0.13542     0.77083      1.1042        0.25],...
% 'backgroundcolor',[0.4        0.55         0.7],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','copyreplaceradio',...
% 'String','Copy & replace',...
% 'HorizontalAlignment','center');
% 
% %pushbutton1
% %----------------
% pushbutton1= uicontrol('units','inches','style','pushbutton',...
% 'position',[2.0625     0.13542      1.1042     0.28125],...
% 'backgroundcolor',[0.83137     0.81569     0.78431],...
% 'foregroundcolor',[0  0  0],...
% 'Callback','renamemanage(filename,filepath,mode)',...
% 'Value',0,...
% 'tag','pushbutton1',...
% 'String','Replace',...
% 'HorizontalAlignment','center');
% 
% %text2
% %----------------
% text2= uicontrol('units','inches','style','text',...
% 'position',[1.3021         0.5     0.79167     0.21875],...
% 'backgroundcolor',[0.4        0.55         0.7],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','text2',...
% 'String','Replace with:',...
% 'HorizontalAlignment','left');
% 
% %text1
% %----------------
% text1= uicontrol('units','inches','style','text',...
% 'position',[1.3125     0.79167     0.73958     0.23958],...
% 'backgroundcolor',[0.4        0.55         0.7],...
% 'foregroundcolor',[0  0  0],...
% 'Value',0,...
% 'tag','text1',...
% 'String','Find-String:',...
% 'HorizontalAlignment','left');

%figure
%---------------
figure1=figure('units','normalized','position',[pppos(1)     pppos(2)+pppos(4)     0.24664     0.17057],'units','normalized',...
'color',[0.4        0.55         0.7],'Name','file rename options:','Numbertitle','off','Resize','on','Menubar','none','units','normalized');

%text8
%----------------
text8= uicontrol('units','normalized','style','text',...
'position',[0.40127     0.61538     0.22611     0.13609],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','text8',...
'String','Find files by:',...
'HorizontalAlignment','left');

%findedit
%----------------
findedit= uicontrol('units','normalized','style','edit',...
'position',[0.6465     0.61538      0.3121     0.13609],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','findedit',...
'HorizontalAlignment','center');

%findstringedit
%----------------
findstringedit= uicontrol('units','normalized','style','edit',...
'position',[0.6465     0.45562      0.3121     0.13609],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','findstringedit',...
'HorizontalAlignment','center');

%replaceedit
%----------------
replaceedit= uicontrol('units','normalized','style','edit',...
'position',[0.6465     0.29586      0.3121     0.13609],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','replaceedit',...
'HorizontalAlignment','center');







%logicpopup
%----------------
logicpopup= uicontrol('units','normalized','style','popupmenu',...
'position',[0.51274     0.81065     0.44904     0.13018],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',1,...
'tag','logicpopup',...
'String',{'contains','does not contain','is equal','is unequal','ends with'},...
'HorizontalAlignment','left');

%findtypepopup
%----------------
findtypepopup= uicontrol('units','normalized','style','popupmenu',...
'position',[0.041401     0.81065     0.43631     0.12426],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',1,...
'tag','findtypepopup',...
'String',{'filename','extension','version'},...
'HorizontalAlignment','center');

%inclsubdirradio
%----------------
inclsubdirradio= uicontrol('units','normalized','style','radiobutton',...
'position',[0.041401     0.60947     0.34395     0.14201],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','inclsubdirradio',...
'String','include subdir',...
'HorizontalAlignment','center');

%cancelbutton
%----------------
cancelbutton= uicontrol('units','normalized','style','pushbutton',...
'position',[0.044586    0.071006     0.56369     0.16568],...
'backgroundcolor',[0.83137     0.81569     0.78431],...
'foregroundcolor',[0  0  0],...
'Callback','close',...
'Value',0,...
'tag','cancelbutton',...
'String','Cancel',...
'HorizontalAlignment','center');

%copyreplaceradio
%----------------
copyreplaceradio= uicontrol('units','normalized','style','radiobutton',...
'position',[0.041401     0.43787     0.33758     0.14201],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','copyreplaceradio',...
'String','Copy & replace',...
'HorizontalAlignment','center');

%pushbutton1
%----------------
pushbutton1= uicontrol('units','normalized','style','pushbutton',...
'position',[0.63057    0.076923     0.33758     0.15976],...
'backgroundcolor',[0.83137     0.81569     0.78431],...
'foregroundcolor',[0  0  0],...
'Callback','renamemanage(filename,filepath,mode)',...
'Value',0,...
'tag','pushbutton1',...
'String','Replace',...
'HorizontalAlignment','center');

%text2
%----------------
text2= uicontrol('units','normalized','style','text',...
'position',[0.39809     0.28402     0.24204     0.12426],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','text2',...
'String','Replace with:',...
'HorizontalAlignment','left');

%text1
%----------------
text1= uicontrol('units','normalized','style','text',...
'position',[0.40127      0.4497     0.22611     0.13609],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','text1',...
'String','Find-String:',...
'HorizontalAlignment','left');