I have configured my emacs as follows, and I would like to open and operate the source files only in the first window(*scratch*).
But the sr-speedbar loves to open the new file in the lastest window(e.g. the newly open *shell* window).
How can I stop it from opening files in some unwanted windows?

I've run into this problem as well. My solution, which I can personally recommend, is to use the purpose package.
It allows you to dedicate specific windows to specific "purposes" which each have user-configurable associated modes; for instance, the
editpurpose might haveprog-modeassociated with it, theviewpurpose might have `info-mode associated with it, etc. Any time a new buffer is to be opened, if there is a window currently dedicated to that purpose, Emacs will force said buffer to be opened in that dedicated window.As an example, my default Emacs "workspace" consists of one large
editwindow, onecommwindow for IRC, and twoadminwindows -- one for RSS and another for email.Highly recommend.